Operating System - HP-UX
1833875 Members
1896 Online
110063 Solutions
New Discussion

/sbin/init.d script failure at bootup

 
Doug Corey_1
Occasional Advisor

/sbin/init.d script failure at bootup

HP-UX 11.11 L1000
/sbin/init.d/xvfb start does not work at boot time

Everything smooth except at boot time the init.d script only starts one of the two processes requires at startup. As soon as the machine boots up I can manually run 'xvfb start' and it works just fine. I have tried making xvfb the last thing to start at boot and same problem. I need some advice on why an init.d script works manually after boot, but not durring the boot (even as the very last thing in init4)

Thanks all
12 REPLIES 12
Sajid_1
Honored Contributor

Re: /sbin/init.d script failure at bootup

Did you check the /etc/rc.log file for any warnings? Make sure that you have the links in rc directories and it's starting with Sxx..Also check /etc/inittab and make sure that your system's default run level is 4. If it is 3, then put the start script in a lower run level.
learn unix ..
Jeff Schussele
Honored Contributor

Re: /sbin/init.d script failure at bootup

Hi Doug,

In which rcx.d directory do you have the link to the /sbin/init.d script?
It *should* be in /sbin/rc3.d as this is the default run-level.

Also sometimes a startup command needs to be run nohup, not often, but sometimes.

What does the /etc/rc.log show when it tries to start the process?

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Tom Danzig
Honored Contributor

Re: /sbin/init.d script failure at bootup

Did you create the symbolic link in the appropriate directory to start it?

i.e. ln -s /sbin/init.d/xvfb /sbin/rc3.d/S900vxfb

Sounds like it may be missing.
Martin Johnson
Honored Contributor

Re: /sbin/init.d script failure at bootup

Have you checked /etc/rc.log for errors? How about /var/adm/syslog/syslog.log?

HTH
Marty
A. Clay Stephenson
Acclaimed Contributor

Re: /sbin/init.d script failure at bootup

If you put the file in init4 (/sbin/rc4/d) and your initdefault in /etc/inittab is set to 3, it will never be triggered because the box never reaches that run-level. Move it to /etc/rc3.d.
If it ain't broke, I can fix that.
Doug Corey_1
Occasional Advisor

Re: /sbin/init.d script failure at bootup

rc.log/syslog shows nothing
I have the appropriate run control symbolic links.

The xvfb start is being issued properly. It seems like more of an xvfb specific matter.
It is like this: 'xvfb start' kicks of procA and procB; at boot time procA starts ok, but procB never comes up. Here are the 2 procs
/usr/bin/X11/X :10 -ac -fbdir /var/X11/Xserver
/usr/bin/X11/mwm -display :10

The mwm -display :10 one will not start at boot. i am looking for advice on what environmetally is different between running a script as su - root and running that script at init time.

Appreciate it

Jeff Schussele
Honored Contributor

Re: /sbin/init.d script failure at bootup

Hi (again) Doug,

Well, you have a fairly sparse environment at boot time. I'd explicitly set any PATH vars as well as any LIB vars in the startup script.
Checking your standard environment as root when you run the command manually should clue you in to what you might need to set.
Also if either of these processes expects a tty to output to, it could be a problem. Then you'd want to get some tput statement(s) in there as well.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Gary Yu
Super Advisor

Re: /sbin/init.d script failure at bootup

Hi Doug,

I have just put a reply to a similar thread today.

It seemed that(to be confirmed by HP) that you can only start Daemon processes from /usr/sbin/init.d, I had same problems before, trying to start a bunch of process at system boot time, but all those process which are not daemons got exit soon after it started, that's why from /etc/rc.log everything seemed fine, but the process is not running.

I would assume that mwm is not a daemon process. My solution is that instead of starting "mwm" directly from /usr/sbin/xvfb, using "at" to schedule it to start after, say 5 mins, then it will work fine.

please let me know if it works.

Gary
Gary Yu
Super Advisor

Re: /sbin/init.d script failure at bootup

woops, type error, should be /sbin/init.d not /usr/sbin/init.d

Gary
Mark Landin
Valued Contributor

Re: /sbin/init.d script failure at bootup

You may want to "nohup" those statements, and also add a "sleep 10" as the last statement. The sleep statement gives the 'nohup' handler time to control the process before the process dies because it's parent script is done.
Sean OB_1
Honored Contributor

Re: /sbin/init.d script failure at bootup

Typically most machines default to run level three.

So make sure to put a link in /sbin/rc3.d as S999xvfb pointing to /sbin/init.d/xvfb.

cd /sbin/rc3.d
ln -s /sbin/init.d/xvfb S999xvfb
chmod 755 S999xvfb

Check /etc/inittab to see what the default run level it.

Check /etc/rc.log to see what if any error messages happen when the system boots.

Finally I would make sure that /sbin/init.d/xvfb sets any environment variables that you need. There may be vars set when you log in that aren't set at boot time so they aren't available when the command is executed.
Sean OB_1
Honored Contributor

Re: /sbin/init.d script failure at bootup

Doug,

Just a reminder to give points out to those who answered your questions. It only takes a moment, and helps make the forums more useful to everyone.

Sean