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
-
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
-
yes, that should be the place
-
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
-
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?
-
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.
-
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.
-
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
-
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
-
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
-
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