Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Sep 2003 23:11:31 -0700
From:      K Anderson <freebsduser@comcast.net>
To:        admin <admin2@enabled.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 4.8 local startup issues
Message-ID:  <3F5D6F13.6030601@comcast.net>
In-Reply-To: <20030909055829.M25351@enabled.com>
References:  <20030909053406.M35653@enabled.com> <3F5D6840.1010606@comcast.net> <20030909055829.M25351@enabled.com>

next in thread | previous in thread | raw e-mail | index | archive | help


admin wrote:
> On Mon, 08 Sep 2003 22:42:24 -0700, K Anderson wrote
> 
>>admin wrote:
>>
>>>running:
>>>FreeBSD 4.8-STABLE
>>>
>>>okay I am having a strange issue.
>>>
>>>after the last reboot after my FreeBSD machine became unreachable - and
>>>required a power cycle.  mostly all processes listed in /usr/local/etc/rc.d
>>>did not start.  this only happens very rarely and has happens after FreeBSD
>>>crashed or is not brought down very cleanly.  can somebody recommend a way to
>>>auto run these scripts - and make sure these files get executed on boot up.
>>>
>>>how can I make sure processes are running correctly with automation.   
>>>
>>>the following line exists in my /etc/defaults/rc.conf file:
>>>
>>>--- snip ---
>>>
>>>local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs.
>>>
>>>--- snip ---
>>>
>>>- noah
>>>_______________________________________________
>>>freebsd-questions@freebsd.org mailing list
>>>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>>>To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>>>
>>
>>You can create some sort of cron task that checks for running 
>>processes and if it doesn't see it then it starts it up accordingly.
> 
> 
> 
> okay cool.  thanks for responding.  do you have an example of a script that
> can do this.  say the machine does not shut down properly - arent there stale
> .pid files left behind.  how do I account for this in the cron job script? 
> are there other ways to write this script to make sure things start properly
> and remain running?
> 
> - Noah
> 
> 
> 
> 
> 
Don't have an example, but you could check the current running jobs 
somehow then match it against a pid in a file and if all matches then 
it's up. if it doesn't match the pid then you can probably assume the 
system isn't running.

You might experiment with some application that starts up and kill it so 
the pid file sticks around. ANd if it does then check the pid files and 
see if it shows up in the list of process. Anyways something like that.

Hmmm, take a gander at the postgresql (if you have it) start up script. 
I think it checks for a given pid and makes an assumption that finding a 
pid means the system is running but goes ahead and tries to start it up 
anyway. My guess is that once a failed postgres starts back it it uses 
the same pid file.

HTH in some way.
I'm off to bed. :)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F5D6F13.6030601>