[systemd-devel] What is the best way to run a shell script through 'ExecStart'

2013-09-30 Thread Muhammad Shakeel

Greetings all,

I have been trying to convert a LSB initscript of a package into 
corresponding systemd service file. Most init scripts are simple and 
translating them into systemd unit files is non-trivial. In this case it 
is a relatively long script involving some loops.


1) Should I write a script file separately and then call it through 
'ExecStart'?

or
2) It would be good (and do-able) idea to fit whole script inside 
ExecStart=/bin/sh -c  script? (If yes, I would prefer it as it will 
free me from hassle of maintaining two files)


If 2) seems appropriate, can anyone please share something which 
involves using of loop inside systemd service file?


Thanks,
Shakeel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] How to permanently disable a service after first boot

2013-09-27 Thread Muhammad Shakeel

Hi,

If there is a foo.service which is required to run during first system 
boot then what is the best solution to permanently disable it afterwards?


I can think of two solutions but I am not sure which one is correct/more 
appropriate.


1) ExecStartPost=systemctl disable foo.service (I doubt this will work)
2) ExecStartPost=/bin/rm -f foo.service (this works for me but is this a 
clean solution?)


Is there any flag in for systemd unit files which can be set to run a 
service on first boot only?


Best Regards,
Shakeel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd service file type

2013-07-24 Thread Muhammad Shakeel

Hi all,

Is there any limitation on file types which can act as a valid unit file 
for systemd? I have seen .socket, .mount, .path and of-course .service.


Or any file with valid syntax can act as a systemd unit file?

Thanks
Shakeel

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel