Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: Lloyd Keen on October 22, 2003, 06:51:14 AM

Title: Running setserial at startup
Post by: Lloyd Keen on October 22, 2003, 06:51:14 AM
I need to add a setserial command to one of the startup files. Where would be the best place to put this command? I was told /etc/rc.d/rc.local Would this be correct?
Many thanks
Title: Re: Running setserial at startup
Post by: cc_skavenger on October 22, 2003, 07:51:07 AM
yes, that should be the place
Title: Re: Running setserial at startup
Post by: Michiel on October 22, 2003, 11:40:38 AM
No. The preferred solution is to place a script in /etc/e-smith/events/local. Changes to rc.local might be overwritten next time you apply an update.

Michiel
Title: Re: Running setserial at startup
Post by: Lloyd Keen on October 22, 2003, 12:12:12 PM
So can I just create a symlink in /etc/e-smith/events/local pointing to the modified /etc/rc.d/rc.local or should I copy rc.local to /etc/e-smith/events/local?
Title: Re: Running setserial at startup
Post by: Michiel on October 22, 2003, 12:26:57 PM
You shouldn't put anything in rc.local at all. Just create a script that does what you want to do, put it in /etc/e-smith/events/local and make it executable. Every executable file that is found in that directory will be run at boot time.
Title: Re: Running setserial at startup
Post by: Lloyd Keen on October 23, 2003, 07:52:46 AM
Hi Michiel,
I tried creating a file called S10setserial made it executable and placed it in /etc/e-smith/events/local and it hung the server just after "starting smb" I think maybe it had something to do with updating the msql database. I let the server go for a while but it had actually hung. When I rebooted there was a message regarding failed to shutdown mysql? Maybe there is a script that tries to write these "events" into the db or something? I dunno. I had to boot into single user mode and remove the file from /etc/e-smith/events/local and the system came straight back up. I was able to reproduce this behaviour twice. I've just modded rc.local and it runs the setserial command OK. I'll send it off to bugs just in case but it's probably something I'm doing wrong.
Title: Re: Running setserial at startup
Post by: Tom Keiser on October 23, 2003, 08:49:26 AM
I know Michiel's method is definitely the best one, generally,  but maybe in this instance the timing is wrong. Things in /etc/e-smith/events/local happen early in the boot cycle, whereas things in rc.local happen at the end.

If the database isn't ready for your command until sometime after /etc/e-smith/events/local is run, then that would explain the hang.

Regards,

Tom
Title: Re: Running setserial at startup
Post by: Lloyd Keen on October 23, 2003, 09:30:04 AM
Hmm I think I might have stuffed up. There is a file in there called S06conf-lilo Maybe this relates to the run-level. So maybe I should have called my file S3setserial or S2. Anyone ideas
Title: Re: Running setserial at startup
Post by: Charlie Brady on October 23, 2003, 11:43:13 PM
Lloyd Keen wrote:

> I've just modded rc.local and it runs the setserial command OK. I'll
> send it off to bugs just in case but it's probably something
> I'm doing wrong.

I'm sorry, but smebugs@mitel.com is unable to help you to debug code changes that you are making. The mailing list devinfo@e-smith.org exists for users to help each other develop code.

Charlie
Title: Re: Running setserial at startup
Post by: Charlie Brady on October 23, 2003, 11:44:21 PM
Tom Keiser wrote:
 
> I know Michiel's method is definitely the best one,
> generally,  but maybe in this instance the timing is wrong.
> Things in /etc/e-smith/events/local happen early in the boot
> cycle, whereas things in rc.local happen at the end.

No, that's not true. "signal-event local" occurs *during* the running of rc.local.

Charlie