LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-17-2011, 06:21 PM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Rep: Reputation: 16
/etc/ini.d script won't start.


Hi,

I've created a script that launches checkgmail application.
Code:
~$ ls -la /etc/init.d/checkgmail.sh 
-rwxr-xr-x 1 root root 250 2011-06-18 00:04 /etc/init.d/checkgmail.sh
Code:
#!/bin/sh

start()
{   
    EXE="/usr/bin/checkgmail"
    
# first we check that the program is installed in its usual place
    if [ ! -e  "$EXE" ]; then
        exit
    fi
    
    sleep 20 && "$EXE" &
}

start
I've installed the script with the command
Code:
sudo update-rc.d checkgmail.sh defaults

After that, I reboot the system, but this script won't start. If I run the command /etc/init.d/checkgmail, the application launched. Why the script won't starts during the initialization?
 
Old 06-17-2011, 08:22 PM   #2
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
Is checkgmail an X application?
Wouldn't it be more efficient to run this from your window manager startup script?

Because the script is being run before X has started, $DISPLAY hasn't been set and therefore cannot find your screen.

You could try setting:
Code:
DISPLAY=:0.0
in your script.

(if checkgmail does not rely on an X server, ignore this post)

Last edited by coralfang; 06-17-2011 at 08:24 PM.
 
Old 06-18-2011, 01:42 PM   #3
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Original Poster
Rep: Reputation: 16
No, it still doesn't work.
 
Old 06-19-2011, 11:42 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
/etc/init.d contains actual scripts; /etc/rcX.d contains the symlinks for each runlevel X (0-5) that actually call the correct init.d files in the correct order
 
  


Reply



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
custom init.d script will start but won't stop Qwerty9119 Red Hat 2 05-03-2007 12:51 PM
custom init.d script will start but won't stop Qwerty9119 Linux - General 2 05-03-2007 12:23 PM
how to run the script from /etc/rc.d/ini.d/somefile. at statup shahidawan Linux - General 1 05-13-2005 04:23 AM
Apache doesn't start first try after tweaking php.ini JBR Linux - Software 1 02-02-2005 07:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:00 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration