Wednesday, July 20, 2011

Executing a script at startup

Having just reinstalled Linux Mint, I needed to install and setup Twonky media server again. Installing was easy with the supplied script, but to start the server (and kill it on shutdown - don't know if this is strictly necessary) you have to create a symbolic link in /etc/rc2.d which points to the twonky script in /etc/init.d and give it a name starting with Snn, where nn is a 2 digit number from 01 to 99:
    sudo ln -s /etc/init.d/twonkyserver /etc/rc2.dS99twonky


To kill the server, do the same in /etc/rc0.d but call the symbolic link Knn:
    sudo ln -s /etc/init.d/twonkyserver /etc/rc0.d/K99twonky

No comments:

Post a Comment