Unix Technical Forum

Why wont servers start at boot, but will manually?

This is a discussion on Why wont servers start at boot, but will manually? within the Sun Solaris Administration forums, part of the Solaris Operating System category; --> I have an SS20 with Solaris 9, configured with both ssh and apache servers. If the machine is rebooted, ...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > Sun Solaris Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 08:33 AM
Who cares anyway
 
Posts: n/a
Default Why wont servers start at boot, but will manually?

I have an SS20 with Solaris 9, configured with both ssh and apache
servers. If the machine is rebooted, neither server will start
automatically, but instead I need to log onto the console and type

# /etc/init.d/sshd start
# /etc/init.d/apache start

and they run as expected.

What I can't understand is why these don't start at boot, despite the
fact there are /etc/rc3.d/S50apache and /etc/rc3.d/S89sshd files,
which are links to the files in /etc/init.d

I assusme the machine is going to run level 3 (but how can I be
sure?), since network connections work okay.

The files in /etc/init.d are owned by root:sys with 744 permissions


Any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 08:33 AM
Sebastian Jaenicke
 
Posts: n/a
Default Re: Why wont servers start at boot, but will manually?

* Who cares anyway <sorry_no_known_address@hotmail.com> wrote:

I do. Get a name.

[..]
> I assusme the machine is going to run level 3 (but how can I be
> sure?), since network connections work okay.


grep initdefault /etc/inittab

- Sebastian

--
Sebastian Jaenicke Disce aut discede!
whois pgpkey-C81115B1 -h whois.ripe.net|perl -ne's-^certif: *--&&print'
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 08:33 AM
Who cares anyway
 
Posts: n/a
Default Re: Why wont servers start at boot, but will manually?

sorry_no_known_address@hotmail.com (Who cares anyway) wrote in message news:<7e8b9873.0407030638.581f40b@posting.google.c om>...
> I have an SS20 with Solaris 9, configured with both ssh and apache
> servers. If the machine is rebooted, neither server will start
> automatically, but instead I need to log onto the console and type
>
> # /etc/init.d/sshd start
> # /etc/init.d/apache start
>
> and they run as expected.
>
> What I can't understand is why these don't start at boot, despite the
> fact there are /etc/rc3.d/S50apache and /etc/rc3.d/S89sshd files,
> which are links to the files in /etc/init.d
>
> I assusme the machine is going to run level 3 (but how can I be
> sure?), since network connections work okay.
>
> The files in /etc/init.d are owned by root:sys with 744 permissions
>
>
> Any ideas?


As someone suggested, I did a grep on /etc/inittab and see it is
indeed run level 3. So any suggestions as to why a machine goes there,
but the sshd and apache servers not started?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 08:33 AM
Tony Curtis
 
Posts: n/a
Default Re: Why wont servers start at boot, but will manually?

>> On 3 Jul 2004 15:03:57 -0700,
>> sorry_no_known_address@hotmail.com (Who cares anyway) said:


> sorry_no_known_address@hotmail.com (Who cares anyway) wrote
> in message
> news:<7e8b9873.0407030638.581f40b@posting.google.c om>...
>> I have an SS20 with Solaris 9, configured with both ssh and
>> apache servers. If the machine is rebooted, neither server
>> will start automatically, but instead I need to log onto
>> the console and type
>>
>> # /etc/init.d/sshd start # /etc/init.d/apache start
>>
>> and they run as expected.
>>
>> What I can't understand is why these don't start at boot,
>> despite the fact there are /etc/rc3.d/S50apache and
>> /etc/rc3.d/S89sshd files, which are links to the files in
>> /etc/init.d
>>
>> I assusme the machine is going to run level 3 (but how can
>> I be sure?), since network connections work okay.
>>
>> The files in /etc/init.d are owned by root:sys with 744
>> permissions
>>
>>
>> Any ideas?


> As someone suggested, I did a grep on /etc/inittab and see
> it is indeed run level 3. So any suggestions as to why a
> machine goes there, but the sshd and apache servers not
> started?


Do a "who -r" just to make sure about the run-level.

Try adding "set -x" to the top of the /etc/init.d scripts
listed above. That way you can see what commands are being
run in the script and where the problem might lie. Also have
a look at what other scripts run *after* the problematic ones
to see if you've created some unacknowledged dependency.

hth
t
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-16-2008, 08:33 AM
0la 0.
 
Posts: n/a
Default Re: Why wont servers start at boot, but will manually?

Who cares anyway wrote:
> I have an SS20 with Solaris 9, configured with both ssh and apache
> servers. If the machine is rebooted, neither server will start
> automatically, but instead I need to log onto the console and type
>
> # /etc/init.d/sshd start
> # /etc/init.d/apache start
>
> and they run as expected.
>
> What I can't understand is why these don't start at boot, despite the
> fact there are /etc/rc3.d/S50apache and /etc/rc3.d/S89sshd files,
> which are links to the files in /etc/init.d
>
> I assusme the machine is going to run level 3 (but how can I be
> sure?), since network connections work okay.
>
> The files in /etc/init.d are owned by root:sys with 744 permissions
>
>
> Any ideas?


Be sure not to use anything else than Bourne shell syntax. Because, I do
believe that the rc scripts are executed in a bourne shell at system
boot. Even if your rc scripts have '#!/usr/bin/ksh', the init scripts
are called from /etc/rc? like 'sh rc.script' or '. rc.script', if i
recall right.

That would make them work when you log in and execute them by hand
yourself, as the #! is interpreted, when you just call on them directly,
ie /etc/rc3.d/S50apache.

/0la
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-16-2008, 08:33 AM
Who cares anyway
 
Posts: n/a
Default Re: Why wont servers start at boot, but will manually?

"0la 0." <mail_less@127.0.0.1> wrote in message news:<AXHFc.4195$dx3.33298@newsb.telia.net>...
> Who cares anyway wrote:
> > I have an SS20 with Solaris 9, configured with both ssh and apache
> > servers. If the machine is rebooted, neither server will start
> > automatically, but instead I need to log onto the console and type
> >
> > # /etc/init.d/sshd start
> > # /etc/init.d/apache start
> >
> > and they run as expected.
> >
> > What I can't understand is why these don't start at boot, despite the
> > fact there are /etc/rc3.d/S50apache and /etc/rc3.d/S89sshd files,
> > which are links to the files in /etc/init.d
> >
> > I assusme the machine is going to run level 3 (but how can I be
> > sure?), since network connections work okay.
> >
> > The files in /etc/init.d are owned by root:sys with 744 permissions
> >
> >
> > Any ideas?

>
> Be sure not to use anything else than Bourne shell syntax. Because, I do
> believe that the rc scripts are executed in a bourne shell at system
> boot. Even if your rc scripts have '#!/usr/bin/ksh', the init scripts
> are called from /etc/rc? like 'sh rc.script' or '. rc.script', if i
> recall right.
>
> That would make them work when you log in and execute them by hand
> yourself, as the #! is interpreted, when you just call on them directly,
> ie /etc/rc3.d/S50apache.
>
> /0la


You *may* have put me on the right track there.

I see all Sun scripts except sysid.net call /sbin/sh, *not* /bin/sh,
whereas my scripts called /bin/sh. I can't see why this should matter,
but perhaps it does.

However, I'm not near the machine now, and so will not reboot it,
because if it fails to correct the problem, the web server will be
down. I'll wait until I am physically close to the machine before
doing a reboot.

Dr. David Kirkby
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-16-2008, 08:33 AM
Who cares anyway
 
Posts: n/a
Default Re: Why wont servers start at boot, but will manually?

sorry_no_known_address@hotmail.com (Who cares anyway) wrote in message news:<7e8b9873.0407030638.581f40b@posting.google.c om>...
> I have an SS20 with Solaris 9, configured with both ssh and apache
> servers. If the machine is rebooted, neither server will start
> automatically, but instead I need to log onto the console and type
>
> # /etc/init.d/sshd start
> # /etc/init.d/apache start
>
> and they run as expected.
>
> What I can't understand is why these don't start at boot, despite the
> fact there are /etc/rc3.d/S50apache and /etc/rc3.d/S89sshd files,
> which are links to the files in /etc/init.d


I have solved this now. The problem was that the scripts called
/bin/sh, when in fact they needed to call /sbin/sh. Changing the first
line of the scripts from

#!/bin/sh

to

#!/sbin/sh

solved it. I'm not sure why the statically linked sh should be needed,
but it seems to be.

/usr is mounted read-only, but I don't see why that should affect
things. Anyway, the problem seems to have gone. Now both servers start
at boot okay.

Dr. David Kirkby
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-16-2008, 08:33 AM
Dave
 
Posts: n/a
Default Re: Why wont servers start at boot, but will manually?

On Mon, 05 Jul 2004 06:57:37 -0700, Who cares anyway wrote:

>> > I assusme the machine is going to run level 3 (but how can I be
>> > sure?), since network connections work okay.


The /etc/inittab will tell you what the default runlevel is upon bootup.

If you want to double-check a server after its up, use 'who -r' to see the
current run-level.

--Dave

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-16-2008, 08:37 AM
Ian Durkacz
 
Posts: n/a
Default Re: Why wont servers start at boot, but will manually?

Who cares anyway (sorry_no_known_address@hotmail.com) wrote:

: I have solved this now. The problem was that the scripts called
: /bin/sh, when in fact they needed to call /sbin/sh. Changing the first
: line of the scripts from

: #!/bin/sh

: to

: #!/sbin/sh

: solved it. I'm not sure why the statically linked sh should be needed,
: but it seems to be.

I don't have access to a Solaris 9 machine, but this sounds definitely
different from preceding versions of Solaris.

If you look at (say) /etc/rc3 on a Solaris 8 machine you can see that
it 'dots' an /etc/rc3.d/S... script if its name ends with .sh; otherwise,
it '/sbin/sh's it. In either case, the #!... line in the script itself
is just a comment.

I would be interested to hear what the Solaris 9 set-up in the /etc/rc3
etc files is when you get a chance to look.

--
+-- ///\ Ian Durkacz ------------------------------------------+
| C-oo Department of Automatic Control & Systems Engineering |
| \ > The University of Sheffield, Sheffield, England |
+--- \_v email: i.durkacz@sheffield.ac.uk ---------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:28 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com