Re: [systemd-devel] Systemd startup question

2018-01-10 Thread Mantas Mikulėnas
On Wed, Jan 10, 2018 at 10:38 PM, Boyce, Kevin P [US] (AS) <
kevin.bo...@ngc.com> wrote:

> Good Afternoon list,
>
>
>
> I am having a problem with my systemd service file and I think I now
> understand the problem. I’ll describe below, but I’m hoping there is a way
> around it which someone may be able to illuminate me on.
>
>
>
> I am developing an rpm package with software which gets installed under
> /opt/my/bin/service.  Imagine I have a corresponding directory in
> /opt/my/etc/systemd/system/my-service.service incorporated into the
> package.  As part of the package installation the post install script runs
> systemctl enable /opt/my/etc/systemd/system/my-service.service
>
>
>
> My service file has an After=basic.target, Before=network.target,
>  WantedBy=Default.target, and  ExecStart=/opt/my/bin/service.
>
>
>
> All of the symlinks appear to be ok.  After installation when the user
> runs systemctl start my-service.service everything works as expected.
>
>
>
> However, when rebooting everything is not so nice.  In the journal one can
> observe the error “Cannot add dependency job for unit my-service.service,
> ignoring: Unit not found.”
>
>
>
> /opt happens to be on a separate partition than / and /usr.  I’m assuming
> during systemd startup that systemd is parsing  everything before /opt is
> moutned and coming across a broken symlink /etc/systemd/system/my-
> service.service.
>
>
>
> Is there any other solution than removing the symlink and installing
> my-service.service unit file in /etc/systemd/system directly?
>
> We have a requirement to keep our software neatly confined in /opt/my.
>

I guess you could pre-mount /opt from your initramfs, similar to the way an
external /usr is mounted?

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


[systemd-devel] how is systemd-journal-gatewayd filtering logs?

2018-01-10 Thread Jameson Graef Rollins
Hello, I'm having another systemd-journal-gatewayd issue...

I'm finding that journal-gatewayd is not returning all logs that are
actually available in the journal to users with appropriate privileges.

In particular, I have a service whose managed ExecStart program is
writing to stdout and stderr, all of which are captured by journald.
Using journalctl I can see all the process output in the logs.  However,
none of this output is available via journal-gatewayd.

Why are these logs being filtered by journal-gatewayd?  How can I force
it to not filter any logs from the journal?

Thanks for the help.

jamie.


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


[systemd-devel] date ranges with systemd-journal-gatewayd

2018-01-10 Thread Jameson Graef Rollins
Hello.  Is it possible to specify date ranges with
systemd-journal-gatewayd (i.e. equivalent of --since= and --until= in
journalctl)?  I see there is a "Range:" header option that allows
restricting entries by "cursor", but I can't figure out how to translate
dates into that interface.

What about the possibility of adding something like a
"date=:" option to the Range: header that would allow
restricting entries by date?

Thanks so much.

jamie.


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


Re: [systemd-devel] systemd-tmpfiles-setup.service inside LXC fails

2018-01-10 Thread Lennart Poettering
On Mi, 10.01.18 13:27, lejeczek (pelj...@yahoo.co.uk) wrote:

> hi everyone
> 
> I guess it fails as below due to container restrictions, I use/run it from
> libvirtd.
> I read on https://libvirt.org/drvlxc.html in "Filesystem mounts":
> "..
> /sys the host "sysfs" instance remounted read-only
> .."
> 
> $ systemctl status -l systemd-tmpfiles-setup.service
> ● systemd-tmpfiles-setup.service - Create Volatile Files and Directories
>    Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-setup.service;
> static; vendor preset: disabled)
>    Active: failed (Result: exit-code) since Wed 2018-01-10 13:05:45 UTC;
> 4min 48s ago
>  Docs: man:tmpfiles.d(5)
>    man:systemd-tmpfiles(8)
>   Process: 36 ExecStart=/usr/bin/systemd-tmpfiles --create --remove --boot
> --exclude-prefix=/dev (code=exited, status=1/FAILURE)
>  Main PID: 36 (code=exited, status=1/FAILURE)
> 
> Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x systemd[1]: Starting
> Create Volatile Files and Directories...
> Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x systemd-tmpfiles[36]:
> Failed to create file /sys/fs/selinux/checkreqprot: Read-only file system
> Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x systemd[1]:
> systemd-tmpfiles-setup.service: main process exited, code=exited,
> status=1/FAILURE
> Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x systemd[1]: Failed to
> start Create Volatile Files and Directories.
> Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x systemd[1]: Unit
> systemd-tmpfiles-setup.service entered failed state.
> Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x systemd[1]:
> systemd-tmpfiles-setup.service failed.
> 
> Would you know it can be fixed?

You can issue "ln -s /dev/null /etc/sysctl.d/selinux-policy.conf"
locally, to mask out the selinux tmpfiles.d snippet (which is shipped
in /usr/lib/tmpfiles.d/selinux-policy.conf) which trigger this.

Lennart

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


Re: [systemd-devel] Systemd startup question

2018-01-10 Thread Lennart Poettering
On Mi, 10.01.18 20:38, Boyce, Kevin P [US] (AS) (kevin.bo...@ngc.com) wrote:

> Good Afternoon list,
> 
> I am having a problem with my systemd service file and I think I now 
> understand the problem. I'll describe below, but I'm hoping there is a way 
> around it which someone may be able to illuminate me on.
> 
> I am developing an rpm package with software which gets installed under 
> /opt/my/bin/service.  Imagine I have a corresponding directory in 
> /opt/my/etc/systemd/system/my-service.service incorporated into the package.  
> As part of the package installation the post install script runs systemctl 
> enable /opt/my/etc/systemd/system/my-service.service
> 
> My service file has an After=basic.target, Before=network.target,  
> WantedBy=Default.target, and  ExecStart=/opt/my/bin/service.
> 
> All of the symlinks appear to be ok.  After installation when the user runs 
> systemctl start my-service.service everything works as expected.
> 
> However, when rebooting everything is not so nice.  In the journal one can 
> observe the error "Cannot add dependency job for unit my-service.service, 
> ignoring: Unit not found."
> 
> /opt happens to be on a separate partition than / and /usr.  I'm assuming 
> during systemd startup that systemd is parsing  everything before /opt is 
> moutned and coming across a broken symlink 
> /etc/systemd/system/my-service.service.
> 
> Is there any other solution than removing the symlink and installing 
> my-service.service unit file in /etc/systemd/system directly?
> We have a requirement to keep our software neatly confined in /opt/my.

We generally require that unit files reside in the search path at
early boot-up. The logic in systemd is designed so that the boot
transaction is calculated early on, and that means we need access to
all units that are supposed to start. Now, /opt is frequently split
out, and hence unit files can't really be located there... Sorry.

You can copy the unit file however in your case, no?

Lennart

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


[systemd-devel] Systemd startup question

2018-01-10 Thread Boyce, Kevin P [US] (AS)
Good Afternoon list,

I am having a problem with my systemd service file and I think I now understand 
the problem. I'll describe below, but I'm hoping there is a way around it which 
someone may be able to illuminate me on.

I am developing an rpm package with software which gets installed under 
/opt/my/bin/service.  Imagine I have a corresponding directory in 
/opt/my/etc/systemd/system/my-service.service incorporated into the package.  
As part of the package installation the post install script runs systemctl 
enable /opt/my/etc/systemd/system/my-service.service

My service file has an After=basic.target, Before=network.target,  
WantedBy=Default.target, and  ExecStart=/opt/my/bin/service.

All of the symlinks appear to be ok.  After installation when the user runs 
systemctl start my-service.service everything works as expected.

However, when rebooting everything is not so nice.  In the journal one can 
observe the error "Cannot add dependency job for unit my-service.service, 
ignoring: Unit not found."

/opt happens to be on a separate partition than / and /usr.  I'm assuming 
during systemd startup that systemd is parsing  everything before /opt is 
moutned and coming across a broken symlink 
/etc/systemd/system/my-service.service.

Is there any other solution than removing the symlink and installing 
my-service.service unit file in /etc/systemd/system directly?
We have a requirement to keep our software neatly confined in /opt/my.

Kind Regards,
Kevin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] snap core 3748 mount failed...what can i do?

2018-01-10 Thread Lennart Poettering
On Mi, 10.01.18 12:36, CC Lapina (lap...@earthlink.net) wrote:

> Hi all,
> 
> I got these error messages when I tried to install Spotify on ubuntu 16.04 
> lts.
> 
> ubuntu_1604 mount[2705]: mount: /snap/core/3748: mount failed: Unknown error 
> -1
> ubuntu_1604 systemd[1]: snap-core-3748.mount: Mount process exited, 
> code=exited status=32
> ubuntu_1604 systemd[1]: Failed to mount Mount unit for core.
> 
> Because of this Spotify never got installed. I would appreciate any help. 
> Thank you!

Please contact the ubuntu snapd maintainers regarding this. This
question is out of focus for systemd upstream, we are not involved in
snap app management.

Thank you for understanding,

Lennart

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


[systemd-devel] snap core 3748 mount failed...what can i do?

2018-01-10 Thread CC Lapina
Hi all,

I got these error messages when I tried to install Spotify on ubuntu 16.04 lts.

ubuntu_1604 mount[2705]: mount: /snap/core/3748: mount failed: Unknown error -1
ubuntu_1604 systemd[1]: snap-core-3748.mount: Mount process exited, code=exited 
status=32
ubuntu_1604 systemd[1]: Failed to mount Mount unit for core.

Because of this Spotify never got installed. I would appreciate any help. Thank 
you!
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to start a task after system boot but only on specific days using systemd.timer

2018-01-10 Thread Lennart Poettering
On Di, 09.01.18 20:28, Joerg Diederich (joerg_dieder...@freenet.de) wrote:

> Hello,
> 
> I have a little (perhaps strange) requirement:
> I want to execute a script about five minutes after system boot, but only on 
> specific weekdays (e. g. Sundays) using systemd.timer. I tried a combination 
> of OnBootSec and OnCalendar like
> 
> OnBootSec=5m
> OnCalendar=Sun
> 
> but this doesn't work. My script executes always after boot. I'm
> running systemd-228-38.1.x86_64 on SuSE LEAP 42.3. Of course, I can
> modify my script to ask for the current weekday, but I thought, it
> would be more elegant to configure it all together in the timer unit
> file.

As explained by others this is not how multiple OnXyz lines work in
timer units: they triggers are combined in an OR not an AND fashion,
if you so will...

That said, I wouldn't be opposed to adding a new "ConditionCalendar="
or something, similar to the other ConditionXYZ= settings in unit
files. It would take the same calendar specifications as OnCalendar=
does and would skip execution if the current time does not match a
specific calendar specification. With that it would be possible to
define unit files that only start on friday, or only in july, or only
in the year 2018...

If you'd be interested in that file an RFE bug, or even better send a
patch! Most likely the patch would be less than 20 lines of code...

Lennart

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


Re: [systemd-devel] How to start a task after system boot but only on specific days using systemd.timer

2018-01-10 Thread Joerg Diederich
> On 10/01/2018 05:17, Andrei Borzenkov wrote:
> > 09.01.2018 22:28, Joerg Diederich пишет:
> >> Hello,
> >>
> >> I have a little (perhaps strange) requirement:
> >> I want to execute a script about five minutes after system boot, but only 
> >> on specific weekdays (e. g. Sundays) using systemd.timer. I tried a 
> >> combination of OnBootSec and OnCalendar like
> >>
> >> OnBootSec=5m
> >> OnCalendar=Sun
> >>
> >> but this doesn't work.
> > Well, it works but not they way you want it :) As documented, multiple
> > directives are additive - timer will trigger when any of them elapses.
> > May be it could be expressed more obviously.
> 
> There is a workaround but it's a bit more complicated than it should be 
> : use multiple timers.
> 
> timer1.timer ; OnBootSec=5m
> timer1.service ; Wants=timer2
> 
> timer2.timer ; Oncalendar=Sun
> 
> 
> Note that you need the intermediate unit, you cant user 
> Unit=timer2.timer in timer1.timer because a timer is not allowed to 
> start another time (I don't know why)
> 
> You can also have a look at https://github.com/systemd/systemd/pull/7023 
> where II suggested something similar for upstream
> 
> Cheers
> Jérémy
> 

Hi Jérémy,

thank you very much for this solution. At the moment I'm not quite sure, if I 
will really implement such a setup. I'm afraid that I will not be able to 
remember what I'm doing here in a year or so ;) I guess, will stick to a script 
based solution working with a single timer firing a few minutes after reboot 
and let the script do the test for the weekend. I think this is easier to 
understand in case of needed maintenance.

Regards,
Joerg

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


[systemd-devel] systemd-tmpfiles-setup.service inside LXC fails

2018-01-10 Thread lejeczek

hi everyone

I guess it fails as below due to container restrictions, I 
use/run it from libvirtd.
I read on https://libvirt.org/drvlxc.html in "Filesystem 
mounts":

"..
/sys the host "sysfs" instance remounted read-only
.."

$ systemctl status -l systemd-tmpfiles-setup.service
● systemd-tmpfiles-setup.service - Create Volatile Files and 
Directories
   Loaded: loaded 
(/usr/lib/systemd/system/systemd-tmpfiles-setup.service; 
static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2018-01-10 
13:05:45 UTC; 4min 48s ago

 Docs: man:tmpfiles.d(5)
   man:systemd-tmpfiles(8)
  Process: 36 ExecStart=/usr/bin/systemd-tmpfiles --create 
--remove --boot --exclude-prefix=/dev (code=exited, 
status=1/FAILURE)

 Main PID: 36 (code=exited, status=1/FAILURE)

Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x 
systemd[1]: Starting Create Volatile Files and Directories...
Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x 
systemd-tmpfiles[36]: Failed to create file 
/sys/fs/selinux/checkreqprot: Read-only file system
Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x 
systemd[1]: systemd-tmpfiles-setup.service: main process 
exited, code=exited, status=1/FAILURE
Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x 
systemd[1]: Failed to start Create Volatile Files and 
Directories.
Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x 
systemd[1]: Unit systemd-tmpfiles-setup.service entered 
failed state.
Jan 10 13:05:45 lxc-ipa2-swir.priv.xx.xx.priv.xx.xx.x 
systemd[1]: systemd-tmpfiles-setup.service failed.


Would you know it can be fixed?
many thanks, L.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to start a task after system boot but only on specific days using systemd.timer

2018-01-10 Thread Jérémy Rosen



On 10/01/2018 05:17, Andrei Borzenkov wrote:

09.01.2018 22:28, Joerg Diederich пишет:

Hello,

I have a little (perhaps strange) requirement:
I want to execute a script about five minutes after system boot, but only on 
specific weekdays (e. g. Sundays) using systemd.timer. I tried a combination of 
OnBootSec and OnCalendar like

OnBootSec=5m
OnCalendar=Sun

but this doesn't work.

Well, it works but not they way you want it :) As documented, multiple
directives are additive - timer will trigger when any of them elapses.
May be it could be expressed more obviously.


There is a workaround but it's a bit more complicated than it should be 
: use multiple timers.


timer1.timer ; OnBootSec=5m
timer1.service ; Wants=timer2

timer2.timer ; Oncalendar=Sun


Note that you need the intermediate unit, you cant user 
Unit=timer2.timer in timer1.timer because a timer is not allowed to 
start another time (I don't know why)


You can also have a look at https://github.com/systemd/systemd/pull/7023 
where II suggested something similar for upstream


Cheers
Jérémy



My script executes always after boot. I'm running systemd-228-38.1.x86_64 on 
SuSE LEAP 42.3. Of course, I can modify my script to ask for the current 
weekday, but I thought, it would be more elegant to configure it all together 
in the timer unit file.

This would likely require new directive or at least new syntax. Timers
define point in time, not period of time.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


--
SMILE 

20 rue des Jardins
92600 Asnières-sur-Seine


*Jérémy ROSEN*
Architecte technique
Responsable de l'expertise Smile-ECS

email jeremy.ro...@smile.fr 
phone +33141402967
url http://www.smile.eu

Twitter  Facebook 
 LinkedIn 
 Github 




Découvrez l’univers Smile, rendez-vous sur smile.eu 



eco Pour la planète, n'imprimez ce mail que si c'est nécessaire
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel