Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-10-24 Thread Lennart Poettering
On Fri, 12.09.14 13:04, lux-integ (lux-in...@btconnect.com) wrote: > I will stick with the tried and tested bash scripts for iptables > then try something like > > ExecStart=/bin/sh -c " path/to/IptablesScript" > > inside a servce file > > will this suffce ? Yes. However, the "/bin/sh -

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-10-23 Thread Dave Reisner
On Wed, Oct 22, 2014 at 12:37:36PM +0100, Simon McVittie wrote: > On 21/10/14 20:30, Lennart Poettering wrote: > > But in cases like the iptables tool (which > > is written in a style that kinda requires the usage of shell scripts > > to invoke it, since it is more a programming language and is sel

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-10-23 Thread Lennart Poettering
On Thu, 23.10.14 09:17, Alexandre Detiste (alexandre.deti...@gmail.com) wrote: > >2014-10-22 13:37 GMT+02:00 Simon McVittie : > > all it would need is for systemd to support StandardInput=/a/file/path > > That feature would be nice. > I have a direct use for this. > Doing '/bin/echo -e line1\\nli

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-10-23 Thread Jóhann B. Guðmundsson
On 10/23/2014 07:17 AM, Alexandre Detiste wrote: 2014-10-22 13:37 GMT+02:00 Simon McVittie: >all it would need is for systemd to support StandardInput=/a/file/path That feature would be nice. I have a direct use for this. Doing '/bin/echo -e line1\\nline2\\nline3 | command' is ugly. Not reall

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-10-23 Thread Alexandre Detiste
>2014-10-22 13:37 GMT+02:00 Simon McVittie : > all it would need is for systemd to support StandardInput=/a/file/path That feature would be nice. I have a direct use for this. Doing '/bin/echo -e line1\\nline2\\nline3 | command' is ugly. https://github.com/systemd-cron/systemd-cron/blob/master/sr

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-10-22 Thread Simon McVittie
On 21/10/14 20:30, Lennart Poettering wrote: > But in cases like the iptables tool (which > is written in a style that kinda requires the usage of shell scripts > to invoke it, since it is more a programming language and is seldom > called just once at boot) If your ruleset is static (e.g. does no

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-10-21 Thread Lennart Poettering
On Fri, 12.09.14 13:04, lux-integ (lux-in...@btconnect.com) wrote: > On Friday 12 September 2014 11:53:23 Simon McVittie wrote: > > The way to do this is to write a script in the programming language of > > your choice (bash is one possibility), and have the systemd service file > > run that. Ther

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-09-12 Thread Jóhann B. Guðmundsson
On 09/12/2014 08:57 AM, lux-integ wrote: Greetings, I am attempting to learn to use systemd. I have an IPtbales script I intend to transform from a bash script to a systemd service file. If it had been technically possible to migrate the legacy sysv initscript to native systemd we ( as in

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-09-12 Thread Reindl Harald
Am 12.09.2014 um 14:04 schrieb lux-integ: > On Friday 12 September 2014 11:53:23 Simon McVittie wrote: >> The way to do this is to write a script in the programming language of >> your choice (bash is one possibility), and have the systemd service file >> run that. There would be little point in s

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-09-12 Thread lux-integ
On Friday 12 September 2014 11:53:23 Simon McVittie wrote: > The way to do this is to write a script in the programming language of > your choice (bash is one possibility), and have the systemd service file > run that. There would be little point in systemd reinventing a generic > script interprete

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-09-12 Thread Simon McVittie
On 12/09/14 09:57, lux-integ wrote: > The question is; is there a way of conditionally procesing lines in systemd > service files such as the following > > ExecStart=/path/to/executible1 > ExecStart=/path/to/executible2 > some condition satisfied ( for example ConditionFileNotEmpty=SomeFile

Re: [systemd-devel] transforming Iptables bash script to systemd service file -help

2014-09-12 Thread Zbigniew Jędrzejewski-Szmek
Hi, this approach doesn't make much sense, for a few reasons. First, having systemd execute each line as a separate command is not very efficient: systemd is doing other things at the same time, and will interleave other jobs with the commands, log lots of things, etc. Second, embedding such cond

[systemd-devel] transforming Iptables bash script to systemd service file -help

2014-09-12 Thread lux-integ
Greetings, I am attempting to learn to use systemd. I have an IPtbales script I intend to transform from a bash script to a systemd service file. It has lines such as iptables -A INPUt -p tcp ..-j ACCEPT which I intend to transform to ExecStart=iptables -A INPUT -p tcp ..-j ACCEPT