How to write script file for root commands for Kingpin

Need help with one of the installers?
cackerso

How to write script file for root commands for Kingpin

Postby cackerso » Wed Sep 23, 2009 23:50

I had gotten previous help with getting Kingpin to run. To get the sound to work in a terminal I can run as root:

chmod a+rw /proc/asound/card0/pcm0p/oss
echo kingpin.x86 0 0 direct > /proc/asound/card0/pcm0p/oss

Then when I start Kingpin I have sound.

Who ever wrote the post:

viewtopic.php?t=916

mentions that they wrote a simple script file to accomplish the above. I can write simple scripts but I have not been able to get one that will work. I guess it's a problem of getting a script file to run a series of commands as root. If it is simple could you post a solution here?

Thanks.

kratz00
liflg member
Posts: 1654
Joined: Fri Oct 22, 2004 16:23

Postby kratz00 » Thu Sep 24, 2009 17:40

In the post you mentioned, they use a Alsa start script, which gets executed during the boot process and runs with root privileges.

cackerso

Postby cackerso » Sun Sep 27, 2009 22:14

Do you know where the alsa boot script is in Lenny? Do you think adding the command suggested is OK or should I just stop being lazy and run the command as root as you suggested before?

kratz00
liflg member
Posts: 1654
Joined: Fri Oct 22, 2004 16:23

Postby kratz00 » Mon Sep 28, 2009 9:40

I have no idea but I assume its:

/etc/init.d/alsa

Backup the existing file before you make any changes.
Adding the stuff should be no problem, make sure to put it in the "start" section of the script.

cackerso

Postby cackerso » Mon Sep 28, 2009 17:16

Thanks,

I asked in a couple of other forums. For Lenny it looks like a possible place to put it is: /etc/init.d/rc.local

I haven't tried it yet but if there is any problem I'll mention it here since there is a slight chance it might be of use for someone else.

cackerso

kratz00
liflg member
Posts: 1654
Joined: Fri Oct 22, 2004 16:23

Postby kratz00 » Mon Sep 28, 2009 19:40

cackerso please keep us up to date, this could definitively help others.

Thanks in advance.

cackerso

Postby cackerso » Wed Oct 14, 2009 23:45

OK here is an interim reply. If you put the following lines near the beginning of the script: /etc/init.d/rc.local, you will get sound in Kingpin occasionally when you boot.

echo kingpin.x86 0 0 direct > /proc/asound/card0/pcm0p/oss
echo kingpin.x86 0 0 disable > /proc/asound/card0/pcm0c/oss
chmod 666 /proc/ascound/card0/pcm0p/oss
chmod 666 /proc/ascound/card0/pcm0c/oss

I asked at the Debian forums and got the following reponse:

Code: Select all
$ su
# cd /etc/init.d
# echo "echo kingpin.x86 0 0 direct > /proc/asound/card0/pcm0p/oss" > alsa
# chmod +x alsa
# update-rc.d alsa start 0123

This gives an error when you hit enter after the last line. I haven't posted back there yet to see what response I get.

cackerso

cackerso

Postby cackerso » Thu Oct 29, 2009 18:56

OK the error in the Debian script is because there is supposed to be a space between 0 1 2 3. But the solution still doesn't work. No sound in Kingpin on boot. The first solution only works intermittently.

I haven't gotten any other feed back. So the best solution remains to run the command in a terminal before starting the game.

cackerso

kratz00
liflg member
Posts: 1654
Joined: Fri Oct 22, 2004 16:23

Postby kratz00 » Fri Oct 30, 2009 18:31

I don't know how Debian handles such things.

But my start script looks like this:

http://nopaste.info/e56f7f1a3c.html

First I make sure snd_pcm_oss is loaded (if build as module) and then
I do the "magic commands" for some game binaries.
(do not mind the other stuff)
This scripts gets executed while booting the system and it's on of the last script that run.

cackerso

Postby cackerso » Mon Nov 09, 2009 21:38

Thank you for the help and especially for the script. I won't be able to try things out for a while since I just creamed my Linux install at home when I tried to resize the partition it was in.

cackerso

kratz00
liflg member
Posts: 1654
Joined: Fri Oct 22, 2004 16:23

Postby kratz00 » Fri Nov 27, 2009 23:19

Bad luck :(

Please report back if your system is running again.


Who is online

Users browsing this forum: No registered users and 1 guest