LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-27-2007, 03:34 PM   #1
anna611
LQ Newbie
 
Registered: Nov 2007
Posts: 4

Rep: Reputation: 0
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!
 
Old 11-27-2007, 03:39 PM   #2
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
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

Last edited by helptonewbie; 11-27-2007 at 03:41 PM.
 
Old 11-27-2007, 03:58 PM   #3
anna611
LQ Newbie
 
Registered: Nov 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by helptonewbie View Post
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.
 
Old 11-27-2007, 04:02 PM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,785
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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.
 
Old 11-27-2007, 04:13 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,280
Blog Entries: 54

Rep: Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854
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.
 
Old 11-27-2007, 04:15 PM   #6
anna611
LQ Newbie
 
Registered: Nov 2007
Posts: 4

Original Poster
Rep: Reputation: 0
is this the same for crontab? because there it also didn't work:

5 03 * * * export DISPLAY=:1 && /usr/bin/skype start
 
Old 11-27-2007, 04:48 PM   #7
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,785
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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.
 
Old 11-27-2007, 04:49 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,280
Blog Entries: 54

Rep: Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854
Try
Code:
5 03 * * * env DISPLAY=":0.0" /usr/bin/skype
?
 
Old 11-27-2007, 05:54 PM   #9
anna611
LQ Newbie
 
Registered: Nov 2007
Posts: 4

Original Poster
Rep: Reputation: 0
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
 
Old 11-28-2007, 12:22 PM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,280
Blog Entries: 54

Rep: Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854
Quote:
Originally Posted by Hangdog42 View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/init.d script tutorial mechdave Programming 1 09-22-2007 11:44 AM
need help with init script batymahn Linux - Server 1 08-23-2007 11:12 AM
Where is the output from my init.d script? PostPCMan Ubuntu 1 07-03-2006 01:09 PM
Adding to init script djgblz Linux - Newbie 4 07-28-2005 10:12 AM
could use some help with my init.d script.... BrianK Linux - General 3 10-31-2002 07:21 PM


All times are GMT -5. The time now is 12:54 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration