LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   script init.d (http://www.linuxquestions.org/questions/linux-newbie-8/script-init-d-602811/)

anna611 11-27-2007 03:34 PM

script init.d
 
am looking for weeks to get my script running.

Just to learn it, I made a test, want to run skype at startup.
How does it work?

I wrote a script 'example'

Code:
Code:

#!/bin/sh

/usr/bin/skype



Placed it in /etc/init.d
did chmod +x example
did update-rc.d example defaults

I thought this would be enough?
I test it by typing /etc/init.d/./example,and it works, skype runs.

But it doesn't work when I restart my computer.

Thank you in advance for helping me!

helptonewbie 11-27-2007 03:39 PM

thats fine now you've put it into /etc/init.d all you need to do is run 'chkconfig --add example' and that will automatically add in symlinks to your script and that script will then run on start-up

http://www.netadmintools.com/art94.html
gives some good info

anna611 11-27-2007 03:58 PM

Quote:

Originally Posted by helptonewbie (Post 2972560)
thats fine now you've put it into /etc/init.d all you need to do is run 'chkconfig --add example' and that will automatically add in symlinks to your script and that script will then run on start-up

http://www.netadmintools.com/art94.html
gives some good info

Thank you for your reply.

But isn't chkconfig for Redhat?

I used update-rc.d example defaults, I think that's the ame.

But still my script is not working.

Hangdog42 11-27-2007 04:02 PM

The scripts in init.d are almost certainly being run as root, not as a normal user. So if you're logging in as the normal user, then Skype hasn't been started for them. And if you're logging in as root, well, you shouldn't be. There is also the issue that Skype probably requires X to be running in order to start, and X may not yet be functioning when the init.d scripts are run.

unSpawn 11-27-2007 04:13 PM

You don't want Skype to start at *system* startup from /etc/init.d since it is an interactive desktop application. Most Desktop Environments allow you to specify applications to startup in one of their configuration screens.

anna611 11-27-2007 04:15 PM

is this the same for crontab? because there it also didn't work:

5 03 * * * export DISPLAY=:1 && /usr/bin/skype start

Hangdog42 11-27-2007 04:48 PM

Maybe you should try explaining your overall goal here because it seems that you're just trying random stuff. And to be honest, I'm not sure that it makes any sense to start Skype as a cron job.

unSpawn 11-27-2007 04:49 PM

Try
Code:

5 03 * * * env DISPLAY=":0.0" /usr/bin/skype
?

anna611 11-27-2007 05:54 PM

Actually just to see how crontab works
and to let people sometimes think I am working at the computer, while I'm just an hour away ... :)

But the most important for test purposes

unSpawn 11-28-2007 12:22 PM

Quote:

Originally Posted by Hangdog42 (Post 2972632)
I'm not sure that it makes any sense to start Skype as a cron job.

Yes it does. And from my POV the train of though isn't that random, it just isn't what it's sposed to be ;-p


All times are GMT -5. The time now is 02:39 AM.