Re: [systemd-devel] [Feature request] A way to native import /proc/cmdline within unit

2013-09-11 Thread Lennart Poettering
On Thu, 01.08.13 19:16, Jan Engelhardt (jeng...@inai.de) wrote:

 
 
 On Tuesday 2013-07-30 02:12, Gerardo Exequiel Pozzi wrote:
 
 In inside systemd unit, I want to avoid shell script if possible, using
 units only, doing things in a systemd way. Anyway for complex tasks
 where systemd does not fit, scripting seems to be necessary.
 
 The systemd way is not {avoiding shell scripts at all cost},
 but avoiding redundant code found in the many sysvinit scripts.
 At least, that is how I see it.

Yes. We want to deemphasize shell scripts, and get them out of the
default boot, but shell is incredibly useful otherwise and here to stay.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [Feature request] A way to native import /proc/cmdline within unit

2013-08-01 Thread Jan Engelhardt

On Tuesday 2013-07-30 02:12, Gerardo Exequiel Pozzi wrote:

In inside systemd unit, I want to avoid shell script if possible, using
units only, doing things in a systemd way. Anyway for complex tasks
where systemd does not fit, scripting seems to be necessary.

The systemd way is not {avoiding shell scripts at all cost},
but avoiding redundant code found in the many sysvinit scripts.
At least, that is how I see it.

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


Re: [systemd-devel] [Feature request] A way to native import /proc/cmdline within unit

2013-07-29 Thread Lennart Poettering
On Thu, 25.07.13 19:35, Gerardo Exequiel Pozzi (vmlinuz...@yahoo.com.ar) wrote:

 On 07/25/2013 05:06 PM, Lennart Poettering wrote:
  On Sat, 20.07.13 16:37, Gerardo Exequiel Pozzi (vmlinuz...@yahoo.com.ar) 
  wrote:
  
  Hello
 
  I am maintainer of Archiso project (The Arch Linux live ISO creator).
 
  I like a feature for systemd within unit files, mainly for importing
  /proc/cmdline in initramfs stage, or in a generic form for any other
  file with a similar format. Something like ImportOneLineFile=, like
  current EnvironmentFile=.
 
  In this way, we can use/pass parameters to Exec*= directives if needed.
  
  So you awant to import kernel cmdline arguments into your environment?
 
 Yes, in a particular unit.
 
  Note that you can do that already with the systemd.setenv= kernel
  command line option. What else do you need?
  
 
 Yes. But doing in this way:
 
 * Makes each variable passed, global to all units.
 * For each parameter that I need to process I need to prefix them.
 
 So for example
 archisobasedir=arch archisolabel=ARCH_201307 checksum=y
 becomes:
 systemd.setenv=archisobasedir=arch
 systemd.setenv=archisolabel=ARCH_201307 systemd.setenv=checksum=y
 
 And if booting via PXE, think about automatic cmdline appended by
 ip=... PXELINUX/IPAPPEND...
 
 The other solution that I have is using a service+script for
 parsing/dumping cmdline in a file, then import with EnvironmentFile= but
 does not look good. Other way maybe is using a generator, but they run
 too early and I need to wait for some things happens before generating
 units in a dynamic way.

Hmm, but how do you process those variables further? In a shell script
anyway? That sounds as if it would be appropriate to also parse
/proc/cmdline from there? Why would it be better to do this in systemd
rather than in the shell script itself?

(or similar: better than in the Pythons script itself, Perl script, C
program ...)

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [Feature request] A way to native import /proc/cmdline within unit

2013-07-29 Thread Gerardo Exequiel Pozzi
On 07/29/2013 08:12 PM, Lennart Poettering wrote:
 On Thu, 25.07.13 19:35, Gerardo Exequiel Pozzi (vmlinuz...@yahoo.com.ar) 
 wrote:
 
 On 07/25/2013 05:06 PM, Lennart Poettering wrote:
 On Sat, 20.07.13 16:37, Gerardo Exequiel Pozzi (vmlinuz...@yahoo.com.ar) 
 wrote:

 Hello

 I am maintainer of Archiso project (The Arch Linux live ISO creator).

 I like a feature for systemd within unit files, mainly for importing
 /proc/cmdline in initramfs stage, or in a generic form for any other
 file with a similar format. Something like ImportOneLineFile=, like
 current EnvironmentFile=.

 In this way, we can use/pass parameters to Exec*= directives if needed.

 So you awant to import kernel cmdline arguments into your environment?

 Yes, in a particular unit.

 Note that you can do that already with the systemd.setenv= kernel
 command line option. What else do you need?


 Yes. But doing in this way:

 * Makes each variable passed, global to all units.
 * For each parameter that I need to process I need to prefix them.

 So for example
 archisobasedir=arch archisolabel=ARCH_201307 checksum=y
 becomes:
 systemd.setenv=archisobasedir=arch
 systemd.setenv=archisolabel=ARCH_201307 systemd.setenv=checksum=y

 And if booting via PXE, think about automatic cmdline appended by
 ip=... PXELINUX/IPAPPEND...

 The other solution that I have is using a service+script for
 parsing/dumping cmdline in a file, then import with EnvironmentFile= but
 does not look good. Other way maybe is using a generator, but they run
 too early and I need to wait for some things happens before generating
 units in a dynamic way.
 
 Hmm, but how do you process those variables further? In a shell script
 anyway? That sounds as if it would be appropriate to also parse
 /proc/cmdline from there? Why would it be better to do this in systemd
 rather than in the shell script itself?
 
 (or similar: better than in the Pythons script itself, Perl script, C
 program ...)
 
 Lennart
 

In inside systemd unit, I want to avoid shell script if possible, using
units only, doing things in a systemd way. Anyway for complex tasks
where systemd does not fit, scripting seems to be necessary.

ExecStart=/usr/bin/program --param=$CMDLINE__ARG_VALUE ...

I think is better because systemd already parse /proc/cmdline, and I
guess that implementing this is easy, but maybe I am wrong.

Thanks for your feedback.

-- 
Gerardo Exequiel Pozzi
\cos^2\alpha + \sin^2\alpha = 1



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [Feature request] A way to native import /proc/cmdline within unit

2013-07-25 Thread Lennart Poettering
On Sat, 20.07.13 16:37, Gerardo Exequiel Pozzi (vmlinuz...@yahoo.com.ar) wrote:

 Hello
 
 I am maintainer of Archiso project (The Arch Linux live ISO creator).
 
 I like a feature for systemd within unit files, mainly for importing
 /proc/cmdline in initramfs stage, or in a generic form for any other
 file with a similar format. Something like ImportOneLineFile=, like
 current EnvironmentFile=.
 
 In this way, we can use/pass parameters to Exec*= directives if needed.

So you awant to import kernel cmdline arguments into your environment?
Note that you can do that already with the systemd.setenv= kernel
command line option. What else do you need?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [Feature request] A way to native import /proc/cmdline within unit

2013-07-25 Thread Gerardo Exequiel Pozzi
On 07/25/2013 05:06 PM, Lennart Poettering wrote:
 On Sat, 20.07.13 16:37, Gerardo Exequiel Pozzi (vmlinuz...@yahoo.com.ar) 
 wrote:
 
 Hello

 I am maintainer of Archiso project (The Arch Linux live ISO creator).

 I like a feature for systemd within unit files, mainly for importing
 /proc/cmdline in initramfs stage, or in a generic form for any other
 file with a similar format. Something like ImportOneLineFile=, like
 current EnvironmentFile=.

 In this way, we can use/pass parameters to Exec*= directives if needed.
 
 So you awant to import kernel cmdline arguments into your environment?

Yes, in a particular unit.

 Note that you can do that already with the systemd.setenv= kernel
 command line option. What else do you need?
 

Yes. But doing in this way:

* Makes each variable passed, global to all units.
* For each parameter that I need to process I need to prefix them.

So for example
archisobasedir=arch archisolabel=ARCH_201307 checksum=y
becomes:
systemd.setenv=archisobasedir=arch
systemd.setenv=archisolabel=ARCH_201307 systemd.setenv=checksum=y

And if booting via PXE, think about automatic cmdline appended by
ip=... PXELINUX/IPAPPEND...

The other solution that I have is using a service+script for
parsing/dumping cmdline in a file, then import with EnvironmentFile= but
does not look good. Other way maybe is using a generator, but they run
too early and I need to wait for some things happens before generating
units in a dynamic way.

 Lennart
 

Thanks for your attention.


-- 
Gerardo Exequiel Pozzi
\cos^2\alpha + \sin^2\alpha = 1



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [Feature request] A way to native import /proc/cmdline within unit

2013-07-20 Thread Gerardo Exequiel Pozzi
Hello

I am maintainer of Archiso project (The Arch Linux live ISO creator).

I like a feature for systemd within unit files, mainly for importing
/proc/cmdline in initramfs stage, or in a generic form for any other
file with a similar format. Something like ImportOneLineFile=, like
current EnvironmentFile=.

In this way, we can use/pass parameters to Exec*= directives if needed.

Thanks you.


-- 
Gerardo Exequiel Pozzi
\cos^2\alpha + \sin^2\alpha = 1



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel