[systemd-devel] Variables in the [Unit] section of a server
Reindl Harald
h.reindl at thelounge.net
Thu Jan 14 13:08:43 PST 2016
Am 14.01.2016 um 21:44 schrieb Lennart Poettering:
> On Thu, 14.01.16 19:52, Reindl Harald (h.reindl at thelounge.net) wrote:
>
>> Am 14.01.2016 um 15:58 schrieb Lennart Poettering:
>>> And no, unit files are not supposed to be a templating language and do
>>> not support generlized variable expansion and quite frankly I should
>>> never even have added the limited env var expansion via
>>> EnvironmentFile= that ExecStart= supports, since it invites people to
>>> externalise settings that way
>>
>> again: it's fine externalise settings when you know what you are
>> doing
>
> Nope, it's a really bad idea, because unnecessary indirection is bad,
> and it defeats things like "systemd-delta" and similar concepts.
you preamture stopped reading
re-use / share things for many if not all deamos would be *good* because
one would not need to re-invent the same namespaces and restricitions
for each and every service with non-shareable snippets
you like that concepts, fine
myself and others don't use or need them
> But anyway, Reindl, there's really no point in having this discussion
> again. Supporting EnvironmentFile= was a bad idea. I know you love it,
> but it was a mistake from a design PoV
no, only because you love other concepts
accept that not everyone love that concepts
not that i am in general against *a lot* of systemd-concepts
the opposite is true, i love a lot of them
but having different ways to do things is a good thing
P.S.:
i would even love to use way more systemd-features like namespaces
everywhere but systemd-run don't work for that now on fedora nor does it
support using it for cronjobs where you want implicit mail if *anything*
goes to stdout/stderr
-------- Weitergeleitete Nachricht --------
Betreff: [systemd-devel] systemd-run via crond: status=208/STDIN
Datum: Thu, 31 Dec 2015 17:23:00 +0100
Von: Reindl Harald <h.reindl at thelounge.net>
Organisation: the lounge interactive design
An: Mailing-List systemd <systemd-devel at lists.freedesktop.org>
systemd-219-26.fc22.x86_64
* in a ssh shell on Fedora 22 the script below works fine
* called via /etc/crontab it fails
* Unknown assignment StandardInput=null
WHY?
the intention is finally spwan namespaces (sadly not possible with
F22/F23 and systemd-run at all) to protect the OS and replace direct
calls in /etc/crontab with such wrappers to get the well known cronmails
if there is any output (and no generate the mails in the scripts is no
valid option - they don#t have to call a MTA directly)
__________________________________________
Dez 31 17:08:01 mail-gw.thelounge.net systemd[1]:
spamfilter-fetch-samples.service: main process exited, code=exited,
status=208/STDIN
Dez 31 17:08:01 mail-gw.thelounge.net systemd[1]: Failed to start
spamfilter-fetch-samples.
Dez 31 17:08:01 mail-gw.thelounge.net systemd[1]: Unit
spamfilter-fetch-samples.service entered failed state.
Dez 31 17:08:01 mail-gw.thelounge.net systemd[1]:
spamfilter-fetch-samples.service failed.
__________________________________________
[root at mail-gw:~]$ cat /usr/local/bin/spamfilter-fetch-samples
#!/usr/bin/dash
/usr/bin/systemd-run -t --service-type=oneshot --quiet --nice=19
--unit=spamfilter-fetch-samples --description=spamfilter-fetch-samples
/usr/bin/php -d
open_basedir="/tmp:/scripts:/usr/local:/var/lib/spamass-milter/training"
/usr/local/bin/workers/spamfilter-fetch-samples.php
# Fedora 24: -p ProtectSystem=full,ProtectHome=yes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20160114/21b42c1c/attachment.sig>
More information about the systemd-devel
mailing list