[systemd-devel] Mounting a partition at the *right* time
Hi, I am facing an issue with a .mount unit file. The task is simple: mount a partition at the *right* time. The system is OpenElec 6.0, which is based on CoreOS. /etc/fstab is on a squashfs, i.e. it cannot be easily modified and is empty: OpenELEC:~/.config/system.d # cat /etc/fstab OpenELEC:~/.config/system.d # I would like to mount /storage/.kodi/.local/storage/sdcard after /storage is mounted and before systemd-tmpfiles-setup.service starts executing: I created this .mount unit file: OpenELEC:~/.config/system.d # cat storage-.kodi-.local-storage-sdcard.mount [Unit] Description=sdcard mount script #Requires=storage.mount #After=storage.mount ConditionPathExists=/storage/.kodi/.local/storage/sdcard Conflicts=umount.target Before=umount.target systemd-tmpfiles-setup.service [Mount] What=/dev/mmcblk0p1 Where=/storage/.kodi/.local/storage/sdcard Options= Type=ext4 [Install] WantedBy=local-fs.target OpenELEC:~/.config/system.d # When booting, I get A start job is running for dev-mmcblk0p1.device (xys / 1min 30s) The device is mounted: OpenELEC:~ # mount|grep mmcblk0p1 /dev/mmcblk0p1 on /var/media/mmcblk0p1-mmc-USD_0xc840a5b2-p type ext4 (rw,nosuid,nodev,noexec,noatime,data=ordered) /dev/mmcblk0p1 on /storage/.kodi/.local/storage/sdcard type ext4 (rw,relatime,data=ordered) OpenELEC:~ # But there is a failed unit: OpenELEC:~ # systemctl --failed --no-pager UNIT LOAD ACTIVE SUBDESCRIPTION ● systemd-tmpfiles-setup.service loaded failed failed Create Volatile Files and Directories LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, i.e. generalization of SUB. SUB= The low-level unit activation state, values depend on unit type. 1 loaded units listed. Pass --all to see loaded but inactive units, too. To show all installed unit files use 'systemctl list-unit-files'. OpenELEC:~ # OpenELEC:~ # systemctl status 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: enabled) Active: failed (Result: exit-code) since Mon 2016-01-04 12:16:44 CET; 1min 50s ago Docs: man:tmpfiles.d(5) man:systemd-tmpfiles(8) Process: 1731 ExecStart=/usr/bin/systemd-tmpfiles --create --remove --boot -- exclude-prefix=/dev (code=exited, status=1/FAILURE) Main PID: 1731 (code=exited, status=1/FAILURE) Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: ACLs are not supported. Ignoring Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: ACLs are not supported. Ignoring Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: ACLs are not supported. Ignoring Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: [/usr/lib/tmpfiles.d/z_03_connman.conf:19] Duplicate line for path "/var/cache", ignoring. Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: stat(/storage/pictures) failed: No such file or directory Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: stat(/storage/videos) failed: No such file or directory Jan 04 12:16:44 OpenELEC systemd[1]: systemd-tmpfiles-setup.service: main process exited, code=exited, status=1/FAILURE Jan 04 12:16:44 OpenELEC systemd[1]: Failed to start Create Volatile Files and Directories. Jan 04 12:16:44 OpenELEC systemd[1]: Unit systemd-tmpfiles-setup.service entered failed state. Jan 04 12:16:44 OpenELEC systemd[1]: systemd-tmpfiles-setup.service failed. OpenELEC:~ # /storage/pictures and /storage/videos are symlinks to the partition I my unit file is supposed to mount: OpenELEC:~ # ls -l /storage/pictures lrwxrwxrwx1 root root36 Dec 28 18:34 /storage/pictures -> .kodi/.local/storage/sdcard/pictures OpenELEC:~ # ls -l /storage/videos lrwxrwxrwx1 root root34 Dec 28 18:36 /storage/videos -> .kodi/.local/storage/sdcard/videos OpenELEC:~ # The dependencies look ok for me (at least I do not see anything circular): OpenELEC:~ # systemctl list-dependencies --no-pager default.target ● ├─kodi.service ● ├─service.multimedia.vdr-addon.service ● ├─graphical.target ● │ ├─unbind-console.service ● │ └─multi-user.target ● │ ├─avahi-daemon.service ● │ ├─connman.service ● │ ├─cron.service ● │ ├─dbus.service ● │ ├─eventlircd.service ● │ ├─lcdd.service ● │ ├─nmbd.service ● │ ├─rpcbind.service ● │ ├─smbd.service ● │ ├─sshd.service ● │ ├─systemd-ask-password-wall.path ● │ ├─systemd-logind.service ● │ ├─systemd-user-sessions.service___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Regarding stable branch in git hub
Title: Samsung Enterprise Portal mySingle Hello systemd developers, I'm wondering if you plan to keep posting stable branches in git-hub.https://github.com/systemd/systemd-stable/branches/staleI'm just waiting for the next stable branch for systemd, and I would liketo know there will be a new one. Thanks, Jaeyong ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Mounting a partition at the *right* time <2nd attempt>
[sorry for the double post, my previous post seems to be truncated] Hi, I am facing an issue with a .mount unit file. The task is simple: mount a partition at the **right** time. The system is OpenElec 6.0, which is based on CoreOS. /etc/fstab is on a squashfs, i.e. it cannot be easily modified and is empty: OpenELEC:~/.config/system.d # cat /etc/fstab OpenELEC:~/.config/system.d # I would like to mount /storage/.kodi/.local/storage/sdcard after /storage is mounted and before systemd-tmpfiles-setup.service starts executing. I created this .mount unit file: OpenELEC:~/.config/system.d # cat storage-.kodi-.local-storage-sdcard.mount [Unit] Description=sdcard mount script #Requires=storage.mount #After=storage.mount ConditionPathExists=/storage/.kodi/.local/storage/sdcard Conflicts=umount.target Before=umount.target systemd-tmpfiles-setup.service [Mount] What=/dev/mmcblk0p1 Where=/storage/.kodi/.local/storage/sdcard Options= Type=ext4 [Install] WantedBy=local-fs.target OpenELEC:~/.config/system.d # When booting, I get A start job is running for dev-mmcblk0p1.device (xys / 1min 30s) The device is mounted after boot though: OpenELEC:~ # mount|grep mmcblk0p1 /dev/mmcblk0p1 on /var/media/mmcblk0p1-mmc-USD_0xc840a5b2-p type ext4 (rw,nosuid,nodev,noexec,noatime,data=ordered) /dev/mmcblk0p1 on /storage/.kodi/.local/storage/sdcard type ext4 (rw,relatime,data=ordered) OpenELEC:~ # There is one failed unit: OpenELEC:~ # systemctl --failed --no-pager UNIT LOAD ACTIVE SUBDESCRIPTION ● systemd-tmpfiles-setup.service loaded failed failed Create Volatile Files and Directories LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, i.e. generalization of SUB. SUB= The low-level unit activation state, values depend on unit type. 1 loaded units listed. Pass --all to see loaded but inactive units, too. To show all installed unit files use 'systemctl list-unit-files'. OpenELEC:~ # OpenELEC:~ # systemctl status 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: enabled) Active: failed (Result: exit-code) since Mon 2016-01-04 12:16:44 CET; 1min 50s ago Docs: man:tmpfiles.d(5) man:systemd-tmpfiles(8) Process: 1731 ExecStart=/usr/bin/systemd-tmpfiles --create --remove --boot -- exclude-prefix=/dev (code=exited, status=1/FAILURE) Main PID: 1731 (code=exited, status=1/FAILURE) Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: ACLs are not supported. Ignoring Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: ACLs are not supported. Ignoring Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: ACLs are not supported. Ignoring Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: [/usr/lib/tmpfiles.d/z_03_connman.conf:19] Duplicate line for path "/var/cache", ignoring. Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: stat(/storage/pictures) failed: No such file or directory Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: stat(/storage/videos) failed: No such file or directory Jan 04 12:16:44 OpenELEC systemd[1]: systemd-tmpfiles-setup.service: main process exited, code=exited, status=1/FAILURE Jan 04 12:16:44 OpenELEC systemd[1]: Failed to start Create Volatile Files and Directories. Jan 04 12:16:44 OpenELEC systemd[1]: Unit systemd-tmpfiles-setup.service entered failed state. Jan 04 12:16:44 OpenELEC systemd[1]: systemd-tmpfiles-setup.service failed. OpenELEC:~ # /storage/pictures and /storage/videos are symlinks to the partition I my unit file is supposed to mount: OpenELEC:~ # ls -l /storage/pictures lrwxrwxrwx1 root root36 Dec 28 18:34 /storage/pictures -> .kodi/.local/storage/sdcard/pictures OpenELEC:~ # ls -l /storage/videos lrwxrwxrwx1 root root34 Dec 28 18:36 /storage/videos -> .kodi/.local/storage/sdcard/videos OpenELEC:~ # The dependencies look ok for me (at least I do not see anything circular): OpenELEC:~ # systemctl list-dependencies --no-pager default.target ● ├─kodi.service ● ├─service.multimedia.vdr-addon.service ● ├─graphical.target ● │ ├─unbind-console.service ● │ └─multi-user.target ● │ ├─avahi-daemon.service ● │ ├─connman.service ● │ ├─cron.service ● │ ├─dbus.service ● │ ├─eventlircd.service ● │ ├─lcdd.service ● │ ├─nmbd.service ● │ ├─rpcbind.service ● │ ├─smbd.service ● │ ├─sshd.service ● │ ├─systemd-ask-password-wall.path ● │ ├─systemd-logind.service ● │ ├─systemd-user-sessions.service ● │ └─basic.target ● │ ├─amlogic-remotecfg.service ● │ ├─hwdb.service ● │ ├─show-version.service ● │ ├─paths.target ● │ ├─slices.target ● │ │ ├─-.slice ● │ │ └─system.slice ● │ ├─sockets.target ● │ │ ├─dbus.socket ● │ │ ├─systemd-initctl.socket ● │ │ ├─systemd-journald-audit.socket ● │ │
Re: [systemd-devel] Mounting a partition at the *right* time
On Mon, Jan 4, 2016 at 1:26 PM, Rainer Dorschwrote: > Hi, > > > > I am facing an issue with a .mount unit file. The task is simple: mount a > partition at the *right* time. > > > > The system is OpenElec 6.0, which is based on CoreOS. /etc/fstab is on a > squashfs, i.e. it cannot be easily modified and is empty: > > > > OpenELEC:~/.config/system.d # cat /etc/fstab > > OpenELEC:~/.config/system.d # > > > > I would like to mount /storage/.kodi/.local/storage/sdcard after /storage > is mounted and before systemd-tmpfiles-setup.service starts executing: > > > > I created this .mount unit file: > > > > OpenELEC:~/.config/system.d # cat > storage-.kodi-.local-storage-sdcard.mount > > [Unit] > > Description=sdcard mount script > > > > #Requires=storage.mount > > #After=storage.mount > > ConditionPathExists=/storage/.kodi/.local/storage/sdcard > > > > Conflicts=umount.target > > Before=umount.target systemd-tmpfiles-setup.service > > > > [Mount] > > What=/dev/mmcblk0p1 > > Where=/storage/.kodi/.local/storage/sdcard > > Options= > > Type=ext4 > > > > > > [Install] > > WantedBy=local-fs.target > > > Having no CoreOS experience, is "~/.config/system.d/" something specific to OpenELEC? I hope you are not trying to use systemd's own ~/.config/systemd/ here, as that just plain doesn't make sense. (The main init system will not look in each user's homedirs, and the per-user instances do not have mount privileges...) Can you check the output of `systemctl status storage-.kodi-.local-storage-sdcard.mount`? -- Mantas Mikulėnas ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Mounting a partition at the *right* time
Hi Mantas, On Monday 04 January 2016 14:29:23 you wrote: > On Mon, Jan 4, 2016 at 1:26 PM, Rainer Dorschwrote: > > Hi, > > > > > > > > I am facing an issue with a .mount unit file. The task is simple: mount a > > partition at the *right* time. > > > > > > > > The system is OpenElec 6.0, which is based on CoreOS. /etc/fstab is on a > > squashfs, i.e. it cannot be easily modified and is empty: > > > > > > > > OpenELEC:~/.config/system.d # cat /etc/fstab > > > > OpenELEC:~/.config/system.d # > > > > > > > > I would like to mount /storage/.kodi/.local/storage/sdcard after /storage > > is mounted and before systemd-tmpfiles-setup.service starts executing: > > > > > > > > I created this .mount unit file: > > > > > > > > OpenELEC:~/.config/system.d # cat > > storage-.kodi-.local-storage-sdcard.mount > > > > [Unit] > > > > Description=sdcard mount script > > > > > > > > #Requires=storage.mount > > > > #After=storage.mount > > > > ConditionPathExists=/storage/.kodi/.local/storage/sdcard > > > > > > > > Conflicts=umount.target > > > > Before=umount.target systemd-tmpfiles-setup.service > > > > > > > > [Mount] > > > > What=/dev/mmcblk0p1 > > > > Where=/storage/.kodi/.local/storage/sdcard > > > > Options= > > > > Type=ext4 > > > > > > > > > > > > [Install] > > > > WantedBy=local-fs.target > > Having no CoreOS experience, is "~/.config/system.d/" something specific to > OpenELEC? I hope you are not trying to use systemd's own ~/.config/systemd/ > here, as that just plain doesn't make sense. (The main init system will not > look in each user's homedirs, and the per-user instances do not have mount > privileges...) I am not an OpenElec expert either (I think it has nothing to do with CoreOS, both are a JeOS implementation). What I understood so far: Everything runs as root, so there should not be any permission issues. It is at least the location in which OpenElec has samples for mount units: OpenELEC:~ # ls -l .config/system.d/ total 56 -rw-r--r--1 root root 28816 Jan 1 1970 README -rw-r--r--1 root root 1773 Jan 1 1970 cifs.mount.sample drwxr-xr-x2 root root 4096 Jan 3 22:39 kodi.target.wants drwxr-xr-x2 root root 4096 Jan 3 22:35 local-fs.target.wants -rw-r--r--1 root root 1730 Jan 1 1970 nfs.mount.sample lrwxrwxrwx1 root root96 Jan 3 22:39 service.multimedia.vdr-addon.service -> /storage/.kodi/addons/service.multimedia.vdr- addon/system.d/service.multimedia.vdr-addon.service -rw-r--r--1 root root 349 Jan 4 12:09 storage-.kodi-.local- storage-sdcard.mount OpenELEC:~ # > Can you check the output of `systemctl status > storage-.kodi-.local-storage-sdcard.mount`? OpenELEC:~ # systemctl status storage-.kodi-.local-storage-sdcard.mount --no- pager ● storage-.kodi-.local-storage-sdcard.mount - sdcard mount script Loaded: loaded (/storage/.config/system.d/storage-.kodi-.local-storage- sdcard.mount; enabled; vendor preset: enabled) Active: active (mounted) since Mon 2016-01-04 14:11:10 CET; 1min 14s ago Where: /storage/.kodi/.local/storage/sdcard What: /dev/mmcblk0p1 Process: 2062 ExecMount=/bin/mount /dev/mmcblk0p1 /storage/.kodi/.local/storage/sdcard -n -t ext4 (code=exited, status=0/SUCCESS) Jan 04 14:11:10 OpenELEC systemd[1]: Mounting sdcard mount script... Jan 04 14:11:10 OpenELEC systemd[1]: Mounted sdcard mount script. OpenELEC:~ # Thanks Rainer -- Rainer Dorsch http://bokomoko.de/ ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Mounting a partition at the *right* time
[please ignore my previous two posts, the have been truncated. In case this happens again, the full post is at http://netcup.bokomoko.de/~rd/systemd-failure.txt] Hi, I am facing an issue with a .mount unit file. The task is simple: mount a partition at the *right* time. The system is OpenElec 6.0, which is based on CoreOS. /etc/fstab is on a squashfs, i.e. it cannot be easily modified and is empty: OpenELEC:~/.config/system.d # cat /etc/fstab OpenELEC:~/.config/system.d # I would like to mount /storage/.kodi/.local/storage/sdcard after /storage is mounted and before systemd-tmpfiles-setup.service starts executing. I created this .mount unit file: OpenELEC:~/.config/system.d # cat storage-.kodi-.local-storage-sdcard.mount [Unit] Description=sdcard mount script #Requires=storage.mount #After=storage.mount ConditionPathExists=/storage/.kodi/.local/storage/sdcard Conflicts=umount.target Before=umount.target systemd-tmpfiles-setup.service [Mount] What=/dev/mmcblk0p1 Where=/storage/.kodi/.local/storage/sdcard Options= Type=ext4 [Install] WantedBy=local-fs.target OpenELEC:~/.config/system.d # When booting, I get A start job is running for dev-mmcblk0p1.device (xys / 1min 30s) The device is mounted after boot though: OpenELEC:~ # mount|grep mmcblk0p1 /dev/mmcblk0p1 on /var/media/mmcblk0p1-mmc-USD_0xc840a5b2-p type ext4 (rw,nosuid,nodev,noexec,noatime,data=ordered) /dev/mmcblk0p1 on /storage/.kodi/.local/storage/sdcard type ext4 (rw,relatime,data=ordered) OpenELEC:~ # There is one failed unit: OpenELEC:~ # systemctl --failed --no-pager UNIT LOAD ACTIVE SUBDESCRIPTION ● systemd-tmpfiles-setup.service loaded failed failed Create Volatile Files and Directories LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, i.e. generalization of SUB. SUB= The low-level unit activation state, values depend on unit type. 1 loaded units listed. Pass --all to see loaded but inactive units, too. To show all installed unit files use 'systemctl list-unit-files'. OpenELEC:~ # OpenELEC:~ # systemctl status 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: enabled) Active: failed (Result: exit-code) since Mon 2016-01-04 12:16:44 CET; 1min 50s ago Docs: man:tmpfiles.d(5) man:systemd-tmpfiles(8) Process: 1731 ExecStart=/usr/bin/systemd-tmpfiles --create --remove --boot -- exclude-prefix=/dev (code=exited, status=1/FAILURE) Main PID: 1731 (code=exited, status=1/FAILURE) Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: ACLs are not supported. Ignoring Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: ACLs are not supported. Ignoring Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: ACLs are not supported. Ignoring Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: [/usr/lib/tmpfiles.d/z_03_connman.conf:19] Duplicate line for path "/var/cache", ignoring. Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: stat(/storage/pictures) failed: No such file or directory Jan 04 12:16:44 OpenELEC systemd-tmpfiles[1731]: stat(/storage/videos) failed: No such file or directory Jan 04 12:16:44 OpenELEC systemd[1]: systemd-tmpfiles-setup.service: main process exited, code=exited, status=1/FAILURE Jan 04 12:16:44 OpenELEC systemd[1]: Failed to start Create Volatile Files and Directories. Jan 04 12:16:44 OpenELEC systemd[1]: Unit systemd-tmpfiles-setup.service entered failed state. Jan 04 12:16:44 OpenELEC systemd[1]: systemd-tmpfiles-setup.service failed. OpenELEC:~ # /storage/pictures and /storage/videos are symlinks to the partition I my unit file is supposed to mount: OpenELEC:~ # ls -l /storage/pictures lrwxrwxrwx1 root root36 Dec 28 18:34 /storage/pictures -> .kodi/.local/storage/sdcard/pictures OpenELEC:~ # ls -l /storage/videos lrwxrwxrwx1 root root34 Dec 28 18:36 /storage/videos -> .kodi/.local/storage/sdcard/videos OpenELEC:~ # The dependencies look ok for me (at least I do not see anything circular): OpenELEC:~ # systemctl list-dependencies --no-pager default.target ● ├─kodi.service ● ├─service.multimedia.vdr-addon.service ● ├─graphical.target ● │ ├─unbind-console.service ● │ └─multi-user.target ● │ ├─avahi-daemon.service ● │ ├─connman.service ● │ ├─cron.service ● │ ├─dbus.service ● │ ├─eventlircd.service ● │ ├─lcdd.service ● │ ├─nmbd.service ● │ ├─rpcbind.service ● │ ├─smbd.service ● │ ├─sshd.service ● │ ├─systemd-ask-password-wall.path ● │ ├─systemd-logind.service ● │ ├─systemd-user-sessions.service ● │ └─basic.target ● │ ├─amlogic-remotecfg.service ● │ ├─hwdb.service ● │ ├─show-version.service ● │ ├─paths.target ● │ ├─slices.target ● │ │ ├─-.slice ● │ │ └─system.slice ● │ ├─sockets.target ● │ │ ├─dbus.socket
Re: [systemd-devel] Mounting a partition at the *right* time
04.01.2016 14:26, Rainer Dorsch пишет: > Hi, > > I am facing an issue with a .mount unit file. The task is simple: mount a > partition at the > *right* time. > > The system is OpenElec 6.0, which is based on CoreOS. /etc/fstab is on a > squashfs, i.e. > it cannot be easily modified and is empty: > > OpenELEC:~/.config/system.d # cat /etc/fstab > OpenELEC:~/.config/system.d # > > I would like to mount /storage/.kodi/.local/storage/sdcard after /storage is > mounted > and before systemd-tmpfiles-setup.service starts executing: > > I created this .mount unit file: > > OpenELEC:~/.config/system.d # cat storage-.kodi-.local-storage-sdcard.mount > [Unit] > Description=sdcard mount script > > #Requires=storage.mount > #After=storage.mount > ConditionPathExists=/storage/.kodi/.local/storage/sdcard > > Conflicts=umount.target > Before=umount.target systemd-tmpfiles-setup.service > This creates dependency loop. systemd-tmpfiles-setup.service is ordered After local-fs.target and mount units by default are ordered Before local-fs.target. Try adding DefaultDependencies=false ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Unable to store fds with systemd and reterive it back again
05.01.2016, 09:11, "Pathangi Janardhanan":Hi, I am using the function sd_pid_notify_with_fds and am unable to store the fds with systemd. My service is a simple echo server, and here is the snippet of code that is being called to store the FDS. I have also included the debug code. // Store the FDs with systemd e = getenv("NOTIFY_SOCKET"); if (e == NULL) { syslog(LOG_NOTICE, "environment variable Notify socket is null"); } else { syslog(LOG_NOTICE, "env. variable Notify Socket =%s %d", e, strlen(e)); } syslog(LOG_NOTICE, "Storing %d number of fds", num_fd); ret = sd_pid_notify_with_fds(0, 0, "FDSTORE=1\n", (const int *) fd, num_fd); syslog(LOG_NOTICE, "Result of sd notify %d", ret); From the debug printf I seeJan 5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: env. variable Notify Socket =/run/systemd/notify 19Jan 5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: Storing 1 number of fdsJan 5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: Result of sd notify -22 The return value seems to be -EINVAL, but looking at the code and the above debug, I am not sure why this is happening? Any help would be great.ThanksJana ,___systemd-devel mailing listsystemd-devel@lists.freedesktop.orghttp://lists.freedesktop.org/mailman/listinfo/systemd-devel Which version of systemd are you using? See https://github.com/systemd/systemd/commit/a5bd3c32abb00ad945282568fd1a97c180b68047That bug affects `systemtctl restart systemd-journald`.See https://github.com/systemd/systemd/issues/2236#issuecomment-167739937 --Best regards,Evgeny Vereshchagin ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Unable to store fds with systemd and reterive it back again
On Tue, Jan 05, 2016 at 01:11:16AM -0500, Pathangi Janardhanan wrote: > Hi, > > I am using the function sd_pid_notify_with_fds and am unable to store the > fds with systemd. My service is a simple echo server, > and here is the snippet of code that is being called to store the FDS. I > have also included the debug code. > > // Store the FDs with systemd > e = getenv("NOTIFY_SOCKET"); > if (e == NULL) { > syslog(LOG_NOTICE, "environment variable Notify socket is null"); > } else { > syslog(LOG_NOTICE, "env. variable Notify Socket =%s %d", e, >strlen(e)); > } > > syslog(LOG_NOTICE, "Storing %d number of fds", num_fd); > ret = sd_pid_notify_with_fds(0, 0, "FDSTORE=1\n", (const int *) fd, >num_fd); > syslog(LOG_NOTICE, "Result of sd notify %d", ret); > > From the debug printf I see > Jan 5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: env. variable Notify > Socket =/run/systemd/notify 19 > Jan 5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: Storing 1 number of > fds > Jan 5 00:37:23 ctoserver11 /usr/bin/myechoser[13640]: Result of sd notify > -22 > > > The return value seems to be -EINVAL, but looking at the code and the > above debug, I am not sure why this is happening? > > Any help would be great. You need to set FileDescriptorStoreMax= to nonzero value in your service's unit file. See man systemd.service -- Tomasz TorczThere exists no separation between gods and men: xmpp: zdzich...@chrome.pl one blends softly casual into the other. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Mounting a partition at the *right* time
Hi Zbyszek, thanks for your reply. On Monday 04 January 2016 13:46:26 Zbigniew Jędrzejewski-Szmek wrote: > On Mon, Jan 04, 2016 at 04:25:14PM +0300, Andrei Borzenkov wrote: > > 04.01.2016 14:26, Rainer Dorsch пишет: > > > Hi, > > > > > > I am facing an issue with a .mount unit file. The task is simple: mount > > > a partition at the *right* time. > > > > > > The system is OpenElec 6.0, which is based on CoreOS. /etc/fstab is on a > > > squashfs, i.e. it cannot be easily modified and is empty: > > > > > > OpenELEC:~/.config/system.d # cat /etc/fstab > > > OpenELEC:~/.config/system.d # > > > > > > I would like to mount /storage/.kodi/.local/storage/sdcard after > > > /storage is mounted and before systemd-tmpfiles-setup.service starts > > > executing: > > > > > > I created this .mount unit file: > > > > > > OpenELEC:~/.config/system.d # cat > > > storage-.kodi-.local-storage-sdcard.mount > > > [Unit] > > > Description=sdcard mount script > > > > > > #Requires=storage.mount > > > #After=storage.mount > > > ConditionPathExists=/storage/.kodi/.local/storage/sdcard > > > > > > Conflicts=umount.target > > > Before=umount.target systemd-tmpfiles-setup.service > > > > This creates dependency loop. systemd-tmpfiles-setup.service is ordered > > After local-fs.target and mount units by default are ordered Before > > local-fs.target. > > No, that looks OK. It's *Before* s-tmpfiles-setup.service, so > there should be no loop. > > Conflicts=umount.target, Requires=storage.mount, After=storage.mount > are added automatically, unless DefaultDependencies=false. So those > settings are not necessary but they should be harmless. > > I don't see anything wrong in your setup... Can you paste the full > boot logs Is that the output of journalctl ? http://sprunge.us/LdVV > and > 'systemctl show storage-.kodi-.local-storage-sdcard.mount'? OpenELEC:~ # systemctl show storage-.kodi-.local-storage-sdcard.mount --no- pager Where=/storage/.kodi/.local/storage/sdcard What=/dev/mmcblk0p1 Options=rw,relatime,data=ordered Type=ext4 TimeoutUSec=1min 30s ControlPID=0 DirectoryMode=0755 SloppyOptions=no Result=success ExecMount={ path=/bin/mount ; argv[]=/bin/mount /dev/mmcblk0p1 /storage/.kodi/.local/storage/sdcard -n -t ext4 ; ignore_errors=no ; start_time=[Mon 2016-01-04 15:51:43 CET] ; stop_time=[Mon 2016-01-04 15:51:43 CET] ; pid=2075 ; code=exited ; status=0 } Slice=system.slice ControlGroup=/system.slice/storage-.kodi-.local-storage-sdcard.mount MemoryCurrent=18446744073709551615 Delegate=no CPUAccounting=no CPUShares=18446744073709551615 StartupCPUShares=18446744073709551615 CPUQuotaPerSecUSec=infinity BlockIOAccounting=no BlockIOWeight=18446744073709551615 StartupBlockIOWeight=18446744073709551615 MemoryAccounting=no MemoryLimit=18446744073709551615 DevicePolicy=auto UMask=0022 LimitCPU=18446744073709551615 LimitFSIZE=18446744073709551615 LimitDATA=18446744073709551615 LimitSTACK=18446744073709551615 LimitCORE=18446744073709551615 LimitRSS=18446744073709551615 LimitNOFILE=4096 LimitAS=18446744073709551615 LimitNPROC=6829 LimitMEMLOCK=65536 LimitLOCKS=18446744073709551615 LimitSIGPENDING=6829 LimitMSGQUEUE=819200 LimitNICE=0 LimitRTPRIO=0 LimitRTTIME=18446744073709551615 OOMScoreAdjust=0 Nice=0 IOScheduling=0 CPUSchedulingPolicy=0 CPUSchedulingPriority=0 TimerSlackNSec=5 CPUSchedulingResetOnFork=no NonBlocking=no StandardInput=null StandardOutput=journal StandardError=inherit TTYReset=no TTYVHangup=no TTYVTDisallocate=no SyslogPriority=30 SyslogLevelPrefix=yes SecureBits=0 CapabilityBoundingSet=18446744073709551615 MountFlags=0 PrivateTmp=no PrivateNetwork=no PrivateDevices=no ProtectHome=no ProtectSystem=no SameProcessGroup=yes IgnoreSIGPIPE=yes NoNewPrivileges=no SystemCallErrorNumber=0 RuntimeDirectoryMode=0755 KillMode=control-group KillSignal=15 SendSIGKILL=yes SendSIGHUP=no Id=storage-.kodi-.local-storage-sdcard.mount Names=storage-.kodi-.local-storage-sdcard.mount Wants=system.slice BindsTo=dev-mmcblk0p1.device WantedBy=local-fs.target dev-mmcblk0p1.device Conflicts=umount.target Before=umount.target systemd-tmpfiles-setup.service After=local-fs-pre.target storage.mount -.mount systemd-journald.socket system.slice dev-mmcblk0p1.device RequiresMountsFor=/storage/.kodi/.local/storage /dev/mmcblk0p1 Description=sdcard mount script LoadState=loaded ActiveState=active SubState=mounted FragmentPath=/storage/.config/system.d/storage-.kodi-.local-storage- sdcard.mount UnitFileState=enabled UnitFilePreset=enabled InactiveExitTimestamp=Mon 2016-01-04 15:51:43 CET InactiveExitTimestampMonotonic=105326827 ActiveEnterTimestamp=Mon 2016-01-04 15:51:43 CET ActiveEnterTimestampMonotonic=105361076 ActiveExitTimestampMonotonic=0 InactiveEnterTimestampMonotonic=0 CanStart=yes CanStop=yes CanReload=yes CanIsolate=no StopWhenUnneeded=no RefuseManualStart=no RefuseManualStop=no AllowIsolate=no DefaultDependencies=yes OnFailureJobMode=replace IgnoreOnIsolate=yes IgnoreOnSnapshot=no NeedDaemonReload=no JobTimeoutUSec=0
Re: [systemd-devel] Mounting a partition at the *right* time
On Mon, 04.01.16 12:26, Rainer Dorsch (m...@bokomoko.de) wrote: > Hi, > > I am facing an issue with a .mount unit file. The task is simple: mount a > partition at the > *right* time. > > The system is OpenElec 6.0, which is based on CoreOS. /etc/fstab is on a > squashfs, i.e. > it cannot be easily modified and is empty: > > OpenELEC:~/.config/system.d # cat /etc/fstab > OpenELEC:~/.config/system.d # > > I would like to mount /storage/.kodi/.local/storage/sdcard after /storage is > mounted > and before systemd-tmpfiles-setup.service starts executing: Note that on systemd mounts automatically gain requirement and ordering dependencies on all mounts that are prefixes of it. Thus, the "after" dep you ask for above is automatically added anyway. > > I created this .mount unit file: > > OpenELEC:~/.config/system.d # cat storage-.kodi-.local-storage-sdcard.mount > [Unit] > Description=sdcard mount script > > #Requires=storage.mount > #After=storage.mount > ConditionPathExists=/storage/.kodi/.local/storage/sdcard This appears unnecessary? Why would you condition on that? > Conflicts=umount.target > Before=umount.target systemd-tmpfiles-setup.service These two lines are entirely unnecessary. Unless you set "DefaultDependencies=no" all mount units will gain automatic deps on umount.target anyway, and are ordered before local-fs.target. As systemd-tmpfiles-setup.service is ordered after local-fs.target it will thus run anyway after your mount. > A start job is running for dev-mmcblk0p1.device (xys / 1min 30s) This indicates that this block device is not actually noticed by systemd. Make sure that the "systemd" tag is set on the block device. Check it with "udevadm info" on it. Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Mounting a partition at the *right* time
On Mon, Jan 04, 2016 at 04:00:30PM +0100, Rainer Dorsch wrote: > Is that the output of journalctl ? > > http://sprunge.us/LdVV Yes. The relevant part is: Jan 04 15:50:12 OpenELEC systemd[1]: Started Apply Kernel Variables. Jan 04 15:51:37 OpenELEC systemd[1]: Job dev-mmcblk0p1.device/start timed out. Jan 04 15:51:37 OpenELEC systemd[1]: Timed out waiting for device dev-mmcblk0p1.device. Jan 04 15:51:37 OpenELEC systemd[1]: Dependency failed for sdcard mount script. Jan 04 15:51:37 OpenELEC systemd[1]: Job storage-.kodi-.local-storage-sdcard.mount/start failed with result 'dependency'. Jan 04 15:51:37 OpenELEC systemd[1]: Job dev-mmcblk0p1.device/start failed with result 'timeout'. Jan 04 15:51:37 OpenELEC systemd[1]: Starting Create Volatile Files and Directories... So nothing happens for 1 min 25 s, and systemd is waiting for the device to appear. This is consistent with the default timeout of 1 min 30 s, which is set by JobTimeoutSec setting of the *device* unit (dev-mmcblk0p1.device in this case). Later on the device appears and systemd starts the storage-.kodi-.local-storage-sdcard.mount as soon as that happens. So you need to figure out why the device does not appear in the alloted time. Does it need more than 1.5 minutes to initialize? Are some modules only loaded later on or something else prevents the detection from hapenning? Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Mounting a partition at the *right* time
On Mon, Jan 04, 2016 at 03:22:48PM +, Zbigniew Jędrzejewski-Szmek wrote: > Jan 04 15:50:12 OpenELEC systemd[1]: Started Apply Kernel Variables. > Jan 04 15:51:37 OpenELEC systemd[1]: Job dev-mmcblk0p1.device/start timed out. > Jan 04 15:51:37 OpenELEC systemd[1]: Timed out waiting for device > dev-mmcblk0p1.device. > Jan 04 15:51:37 OpenELEC systemd[1]: Dependency failed for sdcard mount > script. > Jan 04 15:51:37 OpenELEC systemd[1]: Job > storage-.kodi-.local-storage-sdcard.mount/start failed with result > 'dependency'. > Jan 04 15:51:37 OpenELEC systemd[1]: Job dev-mmcblk0p1.device/start failed > with result 'timeout'. > > So you need to figure out why the device does not appear in the alloted time. > Does it need more than 1.5 minutes to initialize? Are some modules only > loaded later on or something else prevents the detection from hapenning? I've seen it happen when our old friend CONFIG_FHANDLE hasn't been turned on. I think it's still not turned on by default for ARM systems, and the kernel and systemd version looks old enough that it doesn't support the /proc/self/fdinfo way. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Mounting a partition at the *right* time
Hi Richard, On Monday 04 January 2016 15:49:25 Richard Maw wrote: > I've seen it happen when our old friend CONFIG_FHANDLE hasn't been turned > on. I think it's still not turned on by default for ARM systems, > and the kernel and systemd version looks old enough that it doesn't support > the /proc/self/fdinfo way. that does not tell me a whole lot. I certainly cannot upgrade kernel and systemd myself, I can report that to openelec. Can you think of a workaround for my specific issue? Thanks Rainer -- Rainer Dorsch http://bokomoko.de/ ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Mounting a partition at the *right* time
Hi Lennart, On Monday 04 January 2016 16:52:52 you wrote: > On Mon, 04.01.16 12:26, Rainer Dorsch (m...@bokomoko.de) wrote: > > Hi, > > > > I am facing an issue with a .mount unit file. The task is simple: mount a > > partition at the *right* time. > > > > The system is OpenElec 6.0, which is based on CoreOS. /etc/fstab is on a > > squashfs, i.e. it cannot be easily modified and is empty: > > > > OpenELEC:~/.config/system.d # cat /etc/fstab > > OpenELEC:~/.config/system.d # > > > > I would like to mount /storage/.kodi/.local/storage/sdcard after /storage > > is mounted > > and before systemd-tmpfiles-setup.service starts executing: > Note that on systemd mounts automatically gain requirement and > ordering dependencies on all mounts that are prefixes of it. Thus, the > "after" dep you ask for above is automatically added anyway. That is good information. I will remove this one. > > I created this .mount unit file: > > > > OpenELEC:~/.config/system.d # cat > > storage-.kodi-.local-storage-sdcard.mount > > [Unit] > > Description=sdcard mount script > > > > #Requires=storage.mount > > #After=storage.mount > > ConditionPathExists=/storage/.kodi/.local/storage/sdcard > > This appears unnecessary? Why would you condition on that? I did not know that systemd orders the mounts automatically. > > Conflicts=umount.target > > Before=umount.target systemd-tmpfiles-setup.service > > These two lines are entirely unnecessary. Unless you set > "DefaultDependencies=no" all mount units will gain automatic deps on > umount.target anyway, and are ordered before local-fs.target. As > systemd-tmpfiles-setup.service is ordered after local-fs.target it > will thus run anyway after your mount. The umount.target I copied from other .mount files. w/o the systemd-tmpfiles- setup.service I saw that the mount was not complete when systemd-tmpfiles- setup was running (i.e. the links were dangling, since the target was not yet mounted.) > > A start job is running for dev-mmcblk0p1.device (xys / 1min 30s) > > This indicates that this block device is not actually noticed by > systemd. Make sure that the "systemd" tag is set on the block > device. Check it with "udevadm info" on it. OpenELEC:~ # udevadm info /dev/mmcblk0p1 P: /devices/platform/aml_sdio.0/mmc_host/sd/sd:59b4/block/mmcblk0/mmcblk0p1 N: mmcblk0p1 S: disk/by-id/mmc-USD_0xc840a5b2-part1 S: disk/by-path/platform-aml_sdio.0-part1 S: disk/by-uuid/74fc9b84-b391-4331-ac28-963c28312a9a E: DEVLINKS=/dev/disk/by-id/mmc-USD_0xc840a5b2-part1 /dev/disk/by- path/platform-aml_sdio.0-part1 /dev/disk/by-uuid/74fc9b84-b391-4331- ac28-963c28312a9a E: DEVNAME=/dev/mmcblk0p1 E: DEVPATH=/devices/platform/aml_sdio.0/mmc_host/sd/sd:59b4/block/mmcblk0/mmcblk0p1 E: DEVTYPE=partition E: ID_FS_TYPE=ext4 E: ID_FS_USAGE=filesystem E: ID_FS_UUID=74fc9b84-b391-4331-ac28-963c28312a9a E: ID_FS_UUID_ENC=74fc9b84-b391-4331-ac28-963c28312a9a E: ID_FS_VERSION=1.0 E: ID_NAME=USD E: ID_PART_ENTRY_DISK=179:0 E: ID_PART_ENTRY_NUMBER=1 E: ID_PART_ENTRY_OFFSET=2048 E: ID_PART_ENTRY_SCHEME=dos E: ID_PART_ENTRY_SIZE=61829120 E: ID_PART_ENTRY_TYPE=0x83 E: ID_PART_ENTRY_UUID=9d212006-01 E: ID_PART_TABLE_TYPE=dos E: ID_PART_TABLE_UUID=9d212006 E: ID_PATH=platform-aml_sdio.0 E: ID_PATH_TAG=platform-aml_sdio_0 E: ID_SERIAL=0xc840a5b2 E: MAJOR=179 E: MINOR=1 E: PARTN=1 E: SUBSYSTEM=block E: TAGS=:systemd: E: USEC_INITIALIZED=1237893 OpenELEC:~ # udevadm info /dev/mmcblk0 P: /devices/platform/aml_sdio.0/mmc_host/sd/sd:59b4/block/mmcblk0 N: mmcblk0 S: disk/by-id/mmc-USD_0xc840a5b2 S: disk/by-path/platform-aml_sdio.0 E: DEVLINKS=/dev/disk/by-id/mmc-USD_0xc840a5b2 /dev/disk/by-path/platform- aml_sdio.0 E: DEVNAME=/dev/mmcblk0 E: DEVPATH=/devices/platform/aml_sdio.0/mmc_host/sd/sd:59b4/block/mmcblk0 E: DEVTYPE=disk E: ID_NAME=USD E: ID_PART_TABLE_TYPE=dos E: ID_PART_TABLE_UUID=9d212006 E: ID_PATH=platform-aml_sdio.0 E: ID_PATH_TAG=platform-aml_sdio_0 E: ID_SERIAL=0xc840a5b2 E: MAJOR=179 E: MINOR=0 E: NPARTS=1 E: SUBSYSTEM=block E: TAGS=:systemd: E: USEC_INITIALIZED=1237797 OpenELEC:~ # Without the dependencies you marked as unnecessary OpenELEC:~/.config/system.d # cat storage-.kodi-.local-storage-sdcard.mount [Unit] Description=sdcard mount script [Mount] What=/dev/mmcblk0p1 Where=/storage/.kodi/.local/storage/sdcard Options= Type=ext4 [Install] WantedBy=local-fs.target OpenELEC:~/.config/system.d # the A start job is running for dev-mmcblk0p1.device (xys / 1min 30s) goes away, but systemd-tmpfiles-setup.service still fails: OpenELEC:~/.config/system.d # systemctl --failed --no-pager UNIT LOAD ACTIVE SUBDESCRIPTION ● systemd-tmpfiles-setup.service loaded failed failed Create Volatile Files and Directories LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, i.e. generalization of SUB. SUB= The low-level unit activation state, values depend on unit type. 1 loaded units listed. Pass