Re: [systemd-devel] "StandardOutput=console" don't work as expected

2015-12-30 Thread Filipe Brandenburger
Hi,

On Wed, Dec 30, 2015 at 2:52 AM, Michael Chapman  wrote:
> On Wed, 30 Dec 2015, Reindl Harald wrote:
>>> >  i am asking for StandardOutput=console get piped to the terminal
>>> >  systemctl was called - the rest is done by crond as all the years
>>> > before
>>>
>>>  That isn't possible at the moment, and I doubt it will ever be
>>>  supported. The service is executed by systemd, not systemctl, and there
>>>  is no communication channel to return a stream of output from the
>>>  command back to systemctl.
>>
>> since "systemctl start" on the shell waits until the "oneshot" service is
>> finished it can't be impossible that pid 1 geives back the tasks output
>
> Well, it's "impossible" in the sense that systemd doesn't have any code to
> do that, no matter how much you might wish it did.

There's an item in the TODO list for `systemctl start -v ...` that
shows a log of the service in systemctl output:
https://github.com/systemd/systemd/blob/c57d67f718077aadee4e2d0940fb87f513b98671/TODO#L132

This might get closer to what you're suggesting here (even without
StandardOutput=console), though it's still about logs and not really
raw output.

As the TODO item suggests, it's tricky to implement correctly, so not
sure how long until it will be available...

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


Re: [systemd-devel] "StandardOutput=console" don't work as expected

2015-12-30 Thread Martin Pitt
Reindl Harald [2015-12-30 11:10 +0100]:
> i just want systemd *not to touch* the stdout behavior when asked to do so -
> it don't need to know anything about ssh ptys, just don't touch stdout
> 
> i am asking for StandardOutput=console get piped to the terminal systemctl
> was called - the rest is done by crond as all the years before

This isn't how systemd works -- systemctl does *not* run any jobs by
itself, it just asks pid 1 [1] to run a job. Thus the stdout/err of
systemctl are completely irrelevant here.

To do what you want to do, don't put the code that you want to run
into a systemd unit, just run it straight away. Then you don't have
the indirection, and whatever you run will just output straight to
stdout/err.

Martin

[1] Or the user's systemd instance, but in this context it's really
the same thing
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


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


Re: [systemd-devel] "StandardOutput=console" don't work as expected

2015-12-30 Thread Michael Chapman

On Wed, 30 Dec 2015, Reindl Harald wrote:

 Standard mailing list etiquette is to reply-to-all


on which mailing-list is that the case?

be assured it's NOT standard on the majority
on most it is considered rude


OK. I'm not going to argue the matter.


>  i am asking for StandardOutput=console get piped to the terminal
>  systemctl was called - the rest is done by crond as all the years before

 That isn't possible at the moment, and I doubt it will ever be
 supported. The service is executed by systemd, not systemctl, and there
 is no communication channel to return a stream of output from the
 command back to systemctl.


since "systemctl start" on the shell waits until the "oneshot" service is 
finished it can't be impossible that pid 1 geives back the tasks output


Well, it's "impossible" in the sense that systemd doesn't have any code to 
do that, no matter how much you might wish it did.


I don't think there's any point in continuing this discussion any further.

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


Re: [systemd-devel] "StandardOutput=console" don't work as expected

2015-12-30 Thread Martin Pitt
Reindl Harald [2015-12-30 11:35 +0100]:
> in the first mail i wrote: "migrate cronjobs to systemd-units for using
> ReadOnlyDirectory and other security otpions"

OK, I suggest to use systemd-run -t then, like Michael Chapman already
suggested. This should give you both, direct stdout/err and the
possibility of additional security restrictions.

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


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


Re: [systemd-devel] "StandardOutput=console" don't work as expected

2015-12-30 Thread Reindl Harald



Am 30.12.2015 um 12:09 schrieb Martin Pitt:

Reindl Harald [2015-12-30 11:35 +0100]:

in the first mail i wrote: "migrate cronjobs to systemd-units for using
ReadOnlyDirectory and other security otpions"


OK, I suggest to use systemd-run -t then, like Michael Chapman already
suggested. This should give you both, direct stdout/err and the
possibility of additional security restrictions


but that seems no to support a unit-file the way i need it

"If timer option is specified and unit is exist which is
specified with --unit option then command can be omitted" don't help 
much - why can't that not just fireup "systemd-run -t 
--unit=contentlounge-cleanup.service" unconditional since it's a 
oneshot-service?


"systemd-run: unrecognized option '--pty" is BTW a bug
50 "--property=NAME=VALUE" params are not maintainable

[root@srv-rhsoft:~]$ systemd-run -t --unit=contentlounge-cleanup.service
Command line to execute required.

[root@srv-rhsoft:~]$ systemd-run --help
systemd-run [OPTIONS...] {COMMAND} [ARGS...]
Run the specified command in a transient scope or service or timer
unit. If timer option is specified and unit is exist which is
specified with --unit option then command can be omitted.

  -h --help   Show this help
 --versionShow package version
 --user   Run as user unit
  -H --host=[USER@]HOST   Operate on remote host
  -M --machine=CONTAINER  Operate on local container
 --scope  Run this as scope rather than service
 --unit=UNIT  Run under the specified unit name
  -p --property=NAME=VALUESet unit property
 --description=TEXT   Description for unit
 --slice=SLICERun in the specified slice
 --no-block   Do not wait until operation finished
  -r --remain-after-exit  Leave service around until explicitly 
stopped

 --send-sighupSend SIGHUP when terminating
 --service-type=TYPE  Service type
 --uid=USER   Run as system user
 --gid=GROUP  Run as system group
 --nice=NICE  Nice level
 --setenv=NAME=VALUE  Set environment
  -t --ptyRun service on pseudo tty
  -q --quiet  Suppress information messages during 
runtime




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] "StandardOutput=console" don't work as expected

2015-12-30 Thread Michael Chapman

On Wed, 30 Dec 2015, Martin Pitt wrote:

Reindl Harald [2015-12-30 11:35 +0100]:

in the first mail i wrote: "migrate cronjobs to systemd-units for using
ReadOnlyDirectory and other security otpions"


OK, I suggest to use systemd-run -t then, like Michael Chapman already
suggested. This should give you both, direct stdout/err and the
possibility of additional security restrictions.


Ah, neat. I was unaware of the -t (aka --pty) option. I had suggested 
--scope.


I think --scope could be slightly more appropriate for use in a cron job 
since it will pass environment variables from the cron job configuration 
down to the command as normal. With a transient service unit you'd need to 
use --setenv to supply extra environment variables explicitly.


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


Re: [systemd-devel] "StandardOutput=console" don't work as expected

2015-12-30 Thread Reindl Harald



Am 30.12.2015 um 11:25 schrieb Michael Chapman:

On Wed, 30 Dec 2015, Reindl Harald wrote:

Am 30.12.2015 um 10:50 schrieb Mantas Mikulėnas:

 On Wed, Dec 30, 2015 at 11:46 AM, Reindl Harald > wrote:
 Do you really have cronjobs which need to output stuff to ssh
 ptys?

 i have hundrets cronjobs which are running silent and if there is
 something wrong then it's echo'ed which means with crond you get a
 mail

 and *no* it's no option to generate a mail at your own when you
 design software over years which runs aboslutely silent and so you
 know for trigger a alter mail you just need to echo the problem in
 whatever class method and you get also PHP warnings for free

 the whole point of using echo in cronjobs is that you don't need to
 know anything about the mail-environment, frankly even not need to
 have access to the MTA or sendmail binary from your script


 Wait, so you're asking for StandardOutput=console to magically get
piped
 to /usr/sbin/sendmail instead of actual console?


can you please stop press reply-all on a mailing-list or at least
remove the additonal address by hand?


Standard mailing list etiquette is to reply-to-all


on which mailing-list is that the case?

be assured it's NOT standard on the majority
on most it is considered rude


since there's no guarantee the recipient is actually subscribed to the list.


and how did he write to the list then?


You should be able to configure your mail client to deduplicate your
incoming mail


even my server can do that and THAT is the problem - the off-list 
duplicate is faster and hence the message has no list headers which 
breaks "reply-list" in a proper mail client



NO - how do you come to that weird conclusion?

i just want systemd *not to touch* the stdout behavior when asked to
do so - it don't need to know anything about ssh ptys, just don't
touch stdout

i am asking for StandardOutput=console get piped to the terminal
systemctl was called - the rest is done by crond as all the years before


That isn't possible at the moment, and I doubt it will ever be
supported. The service is executed by systemd, not systemctl, and there
is no communication channel to return a stream of output from the
command back to systemctl.


since "systemctl start" on the shell waits until the "oneshot" service 
is finished it can't be impossible that pid 1 geives back the tasks output



It's not entirely clear why you're converting cron jobs to systemd
services. What specifically is wrong with simply running your commands
directly from cron as you have always done before?


why not read the thread start - in the first mail i wrote: "migrate 
cronjobs to systemd-units for using ReadOnlyDirectory and other security 
otpions"


PrivateTmp=yes
PrivateDevices=yes

NoNewPrivileges=yes
CapabilityBoundingSet=CAP_KILL CAP_CHOWN CAP_FOWNER

ReadOnlyDirectories=/etc
ReadOnlyDirectories=/usr
ReadOnlyDirectories=/var/lib
ReadOnlyDirectories=/proc
ReadOnlyDirectories=/sys

InaccessibleDirectories=-/boot
InaccessibleDirectories=-/home
InaccessibleDirectories=-/media
InaccessibleDirectories=-/root
InaccessibleDirectories=-/etc/ssh
InaccessibleDirectories=-/run/dbus
InaccessibleDirectories=-/run/lock
InaccessibleDirectories=-/run/mount
InaccessibleDirectories=-/run/systemd/users
InaccessibleDirectories=-/run/udev
InaccessibleDirectories=-/run/user



If you must involve systemd in some way, you might be able to do what
you want with "systemd-run --scope". This will run your command as a
child process of cron as normal, but will encapsulate the process tree
in a systemd scope unit (so it can take advantage of systemd's resource
control and can be killed through systemctl)





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] "StandardOutput=console" don't work as expected

2015-12-30 Thread Michael Chapman

On Wed, 30 Dec 2015, Reindl Harald wrote:

Am 30.12.2015 um 10:50 schrieb Mantas Mikulėnas:

 On Wed, Dec 30, 2015 at 11:46 AM, Reindl Harald > wrote:
 Do you really have cronjobs which need to output stuff to ssh
 ptys?

 i have hundrets cronjobs which are running silent and if there is
 something wrong then it's echo'ed which means with crond you get a
 mail

 and *no* it's no option to generate a mail at your own when you
 design software over years which runs aboslutely silent and so you
 know for trigger a alter mail you just need to echo the problem in
 whatever class method and you get also PHP warnings for free

 the whole point of using echo in cronjobs is that you don't need to
 know anything about the mail-environment, frankly even not need to
 have access to the MTA or sendmail binary from your script


 Wait, so you're asking for StandardOutput=console to magically get piped
 to /usr/sbin/sendmail instead of actual console?


can you please stop press reply-all on a mailing-list or at least remove the 
additonal address by hand?


Standard mailing list etiquette is to reply-to-all, since there's no 
guarantee the recipient is actually subscribed to the list.


You should be able to configure your mail client to deduplicate your 
incoming mail. There is also a mailing list option available in the 
lists.freedesktop.org web interface ("Avoid duplicate copies of 
messages?").



NO - how do you come to that weird conclusion?

i just want systemd *not to touch* the stdout behavior when asked to do so - 
it don't need to know anything about ssh ptys, just don't touch stdout


i am asking for StandardOutput=console get piped to the terminal systemctl 
was called - the rest is done by crond as all the years before


That isn't possible at the moment, and I doubt it will ever be supported. 
The service is executed by systemd, not systemctl, and there is no 
communication channel to return a stream of output from the command back 
to systemctl.


It's not entirely clear why you're converting cron jobs to systemd 
services. What specifically is wrong with simply running your commands 
directly from cron as you have always done before?


If you must involve systemd in some way, you might be able to do what you 
want with "systemd-run --scope". This will run your command as a child 
process of cron as normal, but will encapsulate the process tree in a 
systemd scope unit (so it can take advantage of systemd's resource control 
and can be killed through systemctl).


Regards,
Michael___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] "StandardOutput=console" don't work as expected

2015-12-30 Thread Reindl Harald


Am 30.12.2015 um 11:52 schrieb Michael Chapman:

On Wed, 30 Dec 2015, Reindl Harald wrote:

 Standard mailing list etiquette is to reply-to-all


on which mailing-list is that the case?

be assured it's NOT standard on the majority
on most it is considered rude


OK. I'm not going to argue the matter.


>  i am asking for StandardOutput=console get piped to the terminal
>  systemctl was called - the rest is done by crond as all the years
before

 That isn't possible at the moment, and I doubt it will ever be
 supported. The service is executed by systemd, not systemctl, and there
 is no communication channel to return a stream of output from the
 command back to systemctl.


since "systemctl start" on the shell waits until the "oneshot" service
is finished it can't be impossible that pid 1 geives back the tasks
output


Well, it's "impossible" in the sense that systemd doesn't have any code
to do that, no matter how much you might wish it did.

I don't think there's any point in continuing this discussion any further


luckily that's a developer list - there was never a point to discuss it 
that long from users to users




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] "StandardOutput=console" don't work as expected

2015-12-30 Thread Mantas Mikulėnas
On Wed, Dec 30, 2015 at 2:40 AM, Reindl Harald 
wrote:

> fine, on a real TTY (CTRL+ALT+F2) the echo appears (cluttered with echo
> and the PID instead just the output) but that don't help much in a
> SSH-Session..
>
>
> Am 30.12.2015 um 01:26 schrieb Reindl Harald:
>
>> why is there only logging instead "TEST" written to the terminal
>> starting a oneshot-service or in case it's a entry in /etc/crontab
>> triggering a cronmail becaus the output?
>>
>> that's not helpful when try to migrate cronjobs to systemd-units for
>> using ReadOnlyDirectory and other security otpions
>>
>
Pretty sure that's normal, +console here always meant /dev/console and not
"whatever stdout systemctl has".

Do you really have cronjobs which need to output stuff to ssh ptys?

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


Re: [systemd-devel] "StandardOutput=console" don't work as expected

2015-12-30 Thread Mantas Mikulėnas
On Wed, Dec 30, 2015 at 11:46 AM, Reindl Harald 
wrote:

>
>
> Am 30.12.2015 um 10:37 schrieb Mantas Mikulėnas:
>
>> On Wed, Dec 30, 2015 at 2:40 AM, Reindl Harald > > wrote:
>>
>> fine, on a real TTY (CTRL+ALT+F2) the echo appears (cluttered with
>> echo and the PID instead just the output) but that don't help much
>> in a SSH-Session..
>>
>>
>> Am 30.12.2015 um 01:26 schrieb Reindl Harald:
>>
>> why is there only logging instead "TEST" written to the terminal
>> starting a oneshot-service or in case it's a entry in /etc/crontab
>> triggering a cronmail becaus the output?
>>
>> that's not helpful when try to migrate cronjobs to systemd-units
>> for
>> using ReadOnlyDirectory and other security otpions
>>
>> Pretty sure that's normal, +console here always meant /dev/console and
>> not "whatever stdout systemctl has".
>>
>> Do you really have cronjobs which need to output stuff to ssh ptys?
>>
>
> i have hundrets cronjobs which are running silent and if there is
> something wrong then it's echo'ed which means with crond you get a mail
>
> and *no* it's no option to generate a mail at your own when you design
> software over years which runs aboslutely silent and so you know for
> trigger a alter mail you just need to echo the problem in whatever class
> method and you get also PHP warnings for free
>
> the whole point of using echo in cronjobs is that you don't need to know
> anything about the mail-environment, frankly even not need to have access
> to the MTA or sendmail binary from your script
>

Wait, so you're asking for StandardOutput=console to magically get piped to
/usr/sbin/sendmail instead of actual console?

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


Re: [systemd-devel] "StandardOutput=console" don't work as expected

2015-12-30 Thread Reindl Harald



Am 30.12.2015 um 11:24 schrieb Martin Pitt:

Reindl Harald [2015-12-30 11:10 +0100]:

i just want systemd *not to touch* the stdout behavior when asked to do so -
it don't need to know anything about ssh ptys, just don't touch stdout

i am asking for StandardOutput=console get piped to the terminal systemctl
was called - the rest is done by crond as all the years before


This isn't how systemd works -- systemctl does *not* run any jobs by
itself, it just asks pid 1 [1] to run a job. Thus the stdout/err of
systemctl are completely irrelevant here.


since "systemctl start" on the shell waits until the "oneshot" service 
is finished it can't be impossible that pid 1 geives back the tasks output



To do what you want to do, don't put the code that you want to run
into a systemd unit, just run it straight away. Then you don't have
the indirection, and whatever you run will just output straight to
stdout/err


in the first mail i wrote: "migrate cronjobs to systemd-units for using 
ReadOnlyDirectory and other security otpions"




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] "StandardOutput=console" don't work as expected

2015-12-30 Thread Reindl Harald



Am 30.12.2015 um 10:37 schrieb Mantas Mikulėnas:

On Wed, Dec 30, 2015 at 2:40 AM, Reindl Harald > wrote:

fine, on a real TTY (CTRL+ALT+F2) the echo appears (cluttered with
echo and the PID instead just the output) but that don't help much
in a SSH-Session..


Am 30.12.2015 um 01:26 schrieb Reindl Harald:

why is there only logging instead "TEST" written to the terminal
starting a oneshot-service or in case it's a entry in /etc/crontab
triggering a cronmail becaus the output?

that's not helpful when try to migrate cronjobs to systemd-units for
using ReadOnlyDirectory and other security otpions

Pretty sure that's normal, +console here always meant /dev/console and
not "whatever stdout systemctl has".

Do you really have cronjobs which need to output stuff to ssh ptys?


i have hundrets cronjobs which are running silent and if there is 
something wrong then it's echo'ed which means with crond you get a mail


and *no* it's no option to generate a mail at your own when you design 
software over years which runs aboslutely silent and so you know for 
trigger a alter mail you just need to echo the problem in whatever class 
method and you get also PHP warnings for free


the whole point of using echo in cronjobs is that you don't need to know 
anything about the mail-environment, frankly even not need to have 
access to the MTA or sendmail binary from your script





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] "StandardOutput=console" don't work as expected

2015-12-30 Thread Reindl Harald



Am 30.12.2015 um 10:50 schrieb Mantas Mikulėnas:

On Wed, Dec 30, 2015 at 11:46 AM, Reindl Harald > wrote:
Do you really have cronjobs which need to output stuff to ssh ptys?

i have hundrets cronjobs which are running silent and if there is
something wrong then it's echo'ed which means with crond you get a mail

and *no* it's no option to generate a mail at your own when you
design software over years which runs aboslutely silent and so you
know for trigger a alter mail you just need to echo the problem in
whatever class method and you get also PHP warnings for free

the whole point of using echo in cronjobs is that you don't need to
know anything about the mail-environment, frankly even not need to
have access to the MTA or sendmail binary from your script


Wait, so you're asking for StandardOutput=console to magically get piped
to /usr/sbin/sendmail instead of actual console?


can you please stop press reply-all on a mailing-list or at least remove 
the additonal address by hand?


NO - how do you come to that weird conclusion?

i just want systemd *not to touch* the stdout behavior when asked to do 
so - it don't need to know anything about ssh ptys, just don't touch stdout


i am asking for StandardOutput=console get piped to the terminal 
systemctl was called - the rest is done by crond as all the years before


if that simple "type=oneshot" service have something to say i want to 
know that *now* and not when i randomly look in logsfiles because that's 
the reason i am able to solve most problems before they are reported 
over years


0,*/15 * * * *  root /usr/bin/systemctl start contentlounge-schedule.service
1,*/20  * * * * root /usr/bin/systemctl start contentlounge-docm.service
2,*/20  * * * * root /usr/bin/systemctl start contentlounge-podcast.service
30 6  * * * root /usr/bin/systemctl start contentlounge-cleanup.service



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] "StandardOutput=console" don't work as expected

2015-12-29 Thread Reindl Harald
why is there only logging instead "TEST" written to the terminal 
starting a oneshot-service or in case it's a entry in /etc/crontab 
triggering a cronmail becaus the output?


that's not helpful when try to migrate cronjobs to systemd-units for 
using ReadOnlyDirectory and other security otpions


[Service]
Type=oneshot
ExecStart=/usr/bin/echo TEST
StandardOutput=syslog+console
StandardError=inherit
__

[root@srv-rhsoft:~]$ > messages
[root@srv-rhsoft:~]$ cat messages
[root@srv-rhsoft:~]$ systemctl start contentlounge-podcast.service
[root@srv-rhsoft:~]$ cat messages
Dec 30 01:25:52 srv-rhsoft systemd: Starting ContentLounge Podcast 
Cronjob...

Dec 30 01:25:53 srv-rhsoft echo: TEST
Dec 30 01:25:53 srv-rhsoft systemd: Started ContentLounge Podcast Cronjob.
[root@srv-rhsoft:~]$



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] "StandardOutput=console" don't work as expected

2015-12-29 Thread Reindl Harald
fine, on a real TTY (CTRL+ALT+F2) the echo appears (cluttered with echo 
and the PID instead just the output) but that don't help much in a 
SSH-Session..


Am 30.12.2015 um 01:26 schrieb Reindl Harald:

why is there only logging instead "TEST" written to the terminal
starting a oneshot-service or in case it's a entry in /etc/crontab
triggering a cronmail becaus the output?

that's not helpful when try to migrate cronjobs to systemd-units for
using ReadOnlyDirectory and other security otpions

[Service]
Type=oneshot
ExecStart=/usr/bin/echo TEST
StandardOutput=syslog+console
StandardError=inherit
__

[root@srv-rhsoft:~]$ > messages
[root@srv-rhsoft:~]$ cat messages
[root@srv-rhsoft:~]$ systemctl start contentlounge-podcast.service
[root@srv-rhsoft:~]$ cat messages
Dec 30 01:25:52 srv-rhsoft systemd: Starting ContentLounge Podcast
Cronjob...
Dec 30 01:25:53 srv-rhsoft echo: TEST
Dec 30 01:25:53 srv-rhsoft systemd: Started ContentLounge Podcast Cronjob.
[root@srv-rhsoft:~]$




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] "StandardOutput=console" don't work as expected

2015-12-29 Thread Andrei Borzenkov
30.12.2015 03:40, Reindl Harald пишет:
> fine, on a real TTY (CTRL+ALT+F2) the echo appears

It is not echo, it is "+console" part of StandardOutput - i.e. it is
still logging, not output.

> (cluttered with echo
> and the PID instead just the output) but that don't help much in a
> SSH-Session..
> 
> Am 30.12.2015 um 01:26 schrieb Reindl Harald:
>> why is there only logging instead "TEST" written to the terminal
>> starting a oneshot-service or in case it's a entry in /etc/crontab
>> triggering a cronmail becaus the output?
>>
>> that's not helpful when try to migrate cronjobs to systemd-units for
>> using ReadOnlyDirectory and other security otpions
>>
>> [Service]
>> Type=oneshot
>> ExecStart=/usr/bin/echo TEST
>> StandardOutput=syslog+console
>> StandardError=inherit
>> __
>>
>> [root@srv-rhsoft:~]$ > messages
>> [root@srv-rhsoft:~]$ cat messages
>> [root@srv-rhsoft:~]$ systemctl start contentlounge-podcast.service
>> [root@srv-rhsoft:~]$ cat messages
>> Dec 30 01:25:52 srv-rhsoft systemd: Starting ContentLounge Podcast
>> Cronjob...
>> Dec 30 01:25:53 srv-rhsoft echo: TEST
>> Dec 30 01:25:53 srv-rhsoft systemd: Started ContentLounge Podcast
>> Cronjob.
>> [root@srv-rhsoft:~]$
> 
> 
> 
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 

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