Bug 72249 - RFE: Ability to set StandardInput to a file
Summary: RFE: Ability to set StandardInput to a file
Status: RESOLVED MOVED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-02 21:16 UTC by jharvell
Modified: 2017-09-14 11:04 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description jharvell 2013-12-02 21:16:42 UTC
I was making an service for iptables, running iptables-restore and discovered that the StandardInput option does not allow me to set the standard input of an exec to a regular file.  This was a little surpirising since there are so many other process properties you can control as documented in the systemd.exec man page.

For iptables-restore, I worked around this limitation by creating the following wrapper script:

{code}
#!/bin/bash
in="$1"
shift
exec $* < "$in"
{code}

It would be nice to avoid the overhead of starting up a shell just to redirect the standard input.
Comment 1 Lennart Poettering 2017-09-14 11:04:43 UTC
https://github.com/systemd/systemd/issues/3991 requests pretty much the same thing. Let's continue discussion there.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.