Brian Millett írta:
Question to the sages:
Why? If the lock file is so important to the success or failure of the
execution of the script, then why not have the rc script write the lock
file?
Because the rc script does not know about what the individual init
scripts do. Think about it. There are two task types:
1. tasks that only require initialization but
does not require de-initialization
2 tasks that require both
Examples of task type #1:
- Delete contents of /tmp on boot.
- Start APM/ACPI (the kernel module, not the daemon).
It does not need to be stopped since the poweroff
functionality need a working pm module.
Examples of task type #2: start and stop daemons, networking, etc.
And there is the possibility of starting an init script
(incidentally) twice.
So it's up to the init script writer to create a lockfile.
Anyway, you should know what you want...
Best regards,
Zoltán Böszörményi