Hi Muhammad, On Mon, Sep 30, 2013 at 3:25 PM, Muhammad Shakeel <[email protected]> wrote: > I have been trying to convert a LSB initscript of a package into > corresponding systemd service fyile. 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 you need something non-trivial (such as loops or a script over more than a couple of lines), then I suggest keeping it in a separate file. Systemd service files intentionally do not support loops (or other control structures). HTH, Tom _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
