On Wed, 26.05.10 13:37, Przemek Klosowski (przemek.klosowski(a)nist.gov) wrote:
On 05/26/2010 12:07 PM, Adam Williamson wrote:
>> It is not like you want to edit the scripts all the time, so there is
>> no reason for them being scripts.
>
> I beg to differ. I've had to create or modify initscripts quite often,
> either as a sysadmin or a packager. If this is now going to require C
> coding skills, I'm not going to be able to do it. I don't think it's
> safe to assume that everyone who needs to write or modify an initscript
> is going to know C. What about people who write apps that need
> initscripts in some other language?
It could work out if systemd provided access to a system() equivalent
which could then execute an arbitrary script.
You can easily hook shell scripts into .service files via stuff like
ExecStartPre=/some/shell/script which will then be executed before the
actual daemon is forked off.
I think one good argument for redoing initscripts is that they are
so
repetitive: most of the content is fairly standard: initialization,
argument parsing, case $1 in start) stop), etc etc. ; stuff that might
as well be done in the common framework.
That is true. Most scripts are 1:1 copies of the init script template of
our guidelines.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/ GnuPG 0x1A015CC4