[SOLVED] Running Systemd service on login (encrypted home partition)

Hi,
I have a dm-crypt/LUKS encrypted home partition that's mounted via PAM on login. I'm trying to use a systemd service (profile-sync-daemon), but the service tries to start and access the home partition before the partition is mounted. The service does seem to start successfully, but it doesn't gain access to necessary files on the home partition and malfunctions later on. Is there a sane hack to somehow delay the start of the service until the relevant partition gets mounted (basically after login)? Manually starting the service after login works just as intended in this case - I'm just looking for a way to automate this process.
I have an idea of starting the service via Openbox autostart, but I've currently failed in my attempts.
Last edited by ggg377 (2015-05-28 18:31:10)

Things got quite complicated and hacky as I researched this so I went out of the box a bit (or took the easy way out, whichever you prefer) and reinstalled Arch with a full disk encryption. All is fine now and I also expect to see less problems overall in the future. If anyone wants to continue researching this it would probably be a good idea to start a new thread.

Similar Messages

  • Systemd doesn't umount (encrypted) /home and /tmp on shutdown

    Hi all,
    as this is my first post in this BBS, I hope I'm actually posting in the correct forum. I also did some research but couldn't really find answers.
    I have a problem with systemd on shutdown. It doesn't unmount my encrypted home partition (and does not close the LUKS partition) and the /tmp partition. The corresponding output from journalctl would be this:
    Oct 09 16:08:18 failenovo systemd[1]: Stopping Local File Systems.
    Oct 09 16:08:18 failenovo systemd[1]: Stopped target Local File Systems.
    Oct 09 16:08:18 failenovo systemd[1]: Unmounting /data...
    Oct 09 16:08:18 failenovo systemd[1]: Unmounting /boot...
    Oct 09 16:08:18 failenovo systemd[1]: Unmounting /home...
    Oct 09 16:08:18 failenovo umount[3995]: umount: /home: target is busy.
    Oct 09 16:08:18 failenovo umount[3995]: (In some cases useful info about processes that use
    Oct 09 16:08:18 failenovo umount[3995]: the device is found by lsof(8) or fuser(1))
    Oct 09 16:08:18 failenovo systemd[1]: Unmounting Temporary Directory...
    Oct 09 16:08:18 failenovo systemd[1]: home.mount mount process exited, code=exited status=32
    Oct 09 16:08:18 failenovo systemd[1]: Failed unmounting /home.
    Oct 09 16:08:18 failenovo systemd[1]: Stopping File System Check on /dev/disk/by-uuid/a9395b0a-e3f8-41d7-9feb-d433173fd5ab...
    Oct 09 16:08:18 failenovo systemd[1]: Stopped File System Check on /dev/disk/by-uuid/a9395b0a-e3f8-41d7-9feb-d433173fd5ab.
    Oct 09 16:08:18 failenovo systemd[1]: Stopping /sys/devices/virtual/block/dm-1.
    Oct 09 16:08:18 failenovo systemd[1]: Deactivated swap /dev/sda1.
    Oct 09 16:08:18 failenovo systemd[1]: Unmounted /boot.
    Oct 09 16:08:18 failenovo systemd[1]: Deactivated swap /dev/disk/by-partuuid/28e18189-6b46-40b5-82f8-d550ee3df47a.
    Oct 09 16:08:18 failenovo systemd[1]: Deactivated swap /dev/disk/by-partlabel/Linux\x20swap.
    Oct 09 16:08:18 failenovo systemd[1]: Deactivated swap /dev/disk/by-id/wwn-0x5000cca615e3f206-part1.
    Oct 09 16:08:18 failenovo systemd[1]: Deactivated swap /dev/disk/by-id/ata-HITACHI_HTS543232A7A384_E2434243JK29XK-part1.
    Oct 09 16:08:18 failenovo systemd[1]: Deactivated swap /dev/disk/by-uuid/4903864c-36f8-4f05-a722-ed726c9ae492.
    Oct 09 16:08:18 failenovo umount[3997]: umount: /tmp: target is busy.
    Oct 09 16:08:18 failenovo umount[3997]: (In some cases useful info about processes that use
    Oct 09 16:08:18 failenovo umount[3997]: the device is found by lsof(8) or fuser(1))
    Oct 09 16:08:18 failenovo systemd[1]: tmp.mount mount process exited, code=exited status=32
    Oct 09 16:08:18 failenovo systemd[1]: Failed unmounting Temporary Directory.
    Oct 09 16:08:18 failenovo systemd[1]: Unmounted /data.
    Oct 09 16:08:18 failenovo systemd[1]: Stopping Local File Systems (Pre).
    Oct 09 16:08:18 failenovo systemd[1]: Stopped target Local File Systems (Pre).
    Oct 09 16:08:18 failenovo systemd[1]: Stopping Remount Root and Kernel File Systems...
    Oct 09 16:08:18 failenovo systemd[1]: Stopped Remount Root and Kernel File Systems.
    Oct 09 16:08:18 failenovo systemd[1]: Starting Shutdown.
    Oct 09 16:08:18 failenovo systemd[1]: Reached target Shutdown.
    Oct 09 16:08:23 failenovo systemd-cryptsetup[3989]: Failed to deactivate: Device or resource busy
    Oct 09 16:08:23 failenovo systemd[1]: [email protected]: control process exited, code=exited status=1
    Oct 09 16:08:23 failenovo systemd[1]: Stopped Cryptography Setup for home.
    Oct 09 16:08:23 failenovo systemd[1]: Unit [email protected] entered failed state.
    Oct 09 16:08:23 failenovo systemd[1]: Starting Unmount All Filesystems.
    Oct 09 16:08:23 failenovo systemd[1]: Reached target Unmount All Filesystems.
    Now, with the usual sysv-init this wouldn't be a problem but with systemd (which I'm new to) this poses a problem. I don't know where to start debugging this issue, really. I haven't found a way to run a script directly before and after the umount.target units starts so I can't really see which files are open or what the problem is at this point.
    Is it possible to drop to a shell on such errors and inspect the problem manually? Or does anyone have a suggestion why systemd doesn't want to unmount these filesystems?
    Here's my /etc/fstab:
    # <file system> <dir> <type> <options> <dump> <pass>
    # /dev/mapper/root LABEL=ROOT
    UUID=27fed041-7765-4f63-a895-a7592113165b / ext4 rw,relatime,data=ordered,discard 0 1
    # /dev/mapper/home LABEL=HOME
    UUID=a9395b0a-e3f8-41d7-9feb-d433173fd5ab /home ext4 rw,relatime,data=ordered,discard 0 2
    # /dev/sdb1
    UUID=1573-8C74 /boot/ vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
    # /dev/sda1 LABEL=SWAP
    UUID=f5097167-6e12-4548-8bef-5f83942a1848 none swap defaults 0 0
    # /dev/sda2 LABEL=DATA
    UUID=dffd1518-d3b5-4d05-8b13-76e6fd841963 /data ext4 defaults 0 2
    and my /etc/crypttab:
    # <name> <device> <password> <options>
    home UUID=01f3da5d-1ca0-4bf2-b5a1-cfe69c597707 /etc/keys/home.key luks,discard
    If you need more information, please do tell! Thanks in advance.
    Cheers,
    gegenschall

    I think the /home part of the issue for me is at least partially due to how I have mpd configured.  I start it with my X session and it persists after I log out, keeping a few files in my home folder open.  If I make sure it is not running, log out to LightDM, and use its menu to reboot, I do not get a journal message about /home.  If I kill mpd, but instead issue a `systemctl reboot/poweroff` command from a terminal in X, the problem returns.  Is this normal?  I guess I expected everything to be automatically cleaned up.
    /tmp, on the other hand, remains a mystery.  If I remove it from my /etc/fstab - to use the default tmp.mount (tmpfs) systemd provides - the problem goes away.  But if I keep it as is, and do something silly like replace /bin/umount with this:
    #!/bin/sh
    /bin/test "$1" = "/tmp" && /bin/date -Ins >> /umount-tmp.log
    /bin/test "$1" = "/tmp" && /bin/lsof /tmp >> /umount-tmp.log
    /bin/umount.real "$@"
    all I get is a list of times.
    Also, I tried following the steps here (Shutdown Completes Eventually), but the output mostly mirrors what I get from journalctl:
    [ 219.132058] systemd[1]: Stopping Local File Systems.
    [ 219.132062] systemd[1]: local-fs.target changed active -> dead
    [ 219.132066] systemd[1]: Job local-fs.target/stop finished, result=done
    [ 219.132091] systemd[1]: Stopped target Local File Systems.
    [ 219.132103] systemd[1]: Unmounting /home...
    [ 219.132136] systemd[1]: About to execute: /bin/umount /home
    [ 219.132329] systemd[1]: Forked /bin/umount as 908
    [ 219.132402] systemd[1]: home.mount changed mounted -> unmounting
    [ 219.132427] systemd[1]: Unmounting /storage...
    [ 219.132480] systemd[1]: About to execute: /bin/umount /storage
    [ 219.132735] systemd[1]: Forked /bin/umount as 909
    [ 219.132805] systemd[1]: storage.mount changed mounted -> unmounting
    [ 219.132825] systemd[1]: Unmounting /tmp...
    [ 219.132872] systemd[1]: About to execute: /bin/umount /tmp
    [ 219.133047] systemd[1]: Forked /bin/umount as 910
    [ 219.133109] systemd[1]: tmp.mount changed mounted -> unmounting
    [ 219.133136] systemd[1]: Unmounting /boot...
    [ 219.133190] systemd[1]: About to execute: /bin/umount /boot
    [ 219.133355] systemd[909]: Executing: /bin/umount /storage
    [ 219.133388] systemd[1]: Forked /bin/umount as 911
    [ 219.133452] systemd[1]: boot.mount changed mounted -> unmounting
    [ 219.133676] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 219.134256] systemd[906]: Executing: /usr/lib/systemd/systemd-random-seed save
    [ 219.134550] systemd[908]: Executing: /bin/umount /home
    [ 219.135143] systemd[1]: Received SIGCHLD from PID 906 (systemd-random-).
    [ 219.135170] systemd[1]: Got SIGCHLD for process 906 (systemd-random-)
    [ 219.135222] systemd[1]: Child 906 died (code=exited, status=0/SUCCESS)
    [ 219.135226] systemd[1]: Child 906 belongs to systemd-random-seed.service
    [ 219.135235] systemd[1]: systemd-random-seed.service: control process exited, code=exited status=0
    [ 219.135292] systemd[907]: Executing: /sbin/swapoff /dev/dm-2
    [ 219.135462] systemd[910]: Executing: /bin/umount /tmp
    [ 219.135487] systemd[1]: systemd-random-seed.service got final SIGCHLD for state stop
    [ 219.135528] systemd[1]: systemd-random-seed.service changed stop -> dead
    [ 219.135582] systemd[911]: Executing: /bin/umount /boot
    [ 219.135622] systemd[1]: Job systemd-random-seed.service/stop finished, result=done
    [ 219.135666] systemd[1]: Stopped Load/Save Random Seed.
    [ 219.135695] systemd[1]: Unmounting /var...
    [ 219.135730] systemd[1]: About to execute: /bin/umount /var
    [ 219.135974] systemd[1]: Forked /bin/umount as 914
    [ 219.136050] systemd[1]: var.mount changed mounted -> unmounting
    [ 219.136290] systemd[1]: Accepted connection on private bus.
    [ 219.136332] systemd[1]: Accepted connection on private bus.
    [ 219.136529] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 219.136584] systemd[914]: Executing: /bin/umount /var
    [ 219.136890] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 219.137193] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 219.137222] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 219.175076] systemd[1]: Received SIGCHLD from PID 754 (sudo).
    [ 219.175102] systemd[1]: Got SIGCHLD for process 754 (sudo)
    [ 219.175155] systemd[1]: Child 754 died (code=exited, status=129/n/a)
    [ 219.200239] systemd[1]: Received SIGCHLD from PID 910 (umount).
    [ 219.200267] systemd[1]: Got SIGCHLD for process 908 (umount)
    [ 219.200338] systemd[1]: Child 908 died (code=exited, status=32/n/a)
    [ 219.200342] systemd[1]: Child 908 belongs to home.mount
    [ 219.200347] systemd[1]: home.mount mount process exited, code=exited status=32
    [ 219.200357] systemd[1]: home.mount changed unmounting -> mounted
    [ 219.200362] systemd[1]: Job home.mount/stop finished, result=failed
    [ 219.200407] systemd[1]: Failed unmounting /home.
    [ 219.200454] systemd[1]: Got SIGCHLD for process 910 (umount)
    [ 219.200524] systemd[1]: Child 910 died (code=exited, status=32/n/a)
    [ 219.200527] systemd[1]: Child 910 belongs to tmp.mount
    [ 219.200532] systemd[1]: tmp.mount mount process exited, code=exited status=32
    [ 219.200540] systemd[1]: tmp.mount changed unmounting -> mounted
    [ 219.200544] systemd[1]: Job tmp.mount/stop finished, result=failed
    [ 219.200571] systemd[1]: Failed unmounting /tmp.
    [ 219.200607] systemd[1]: Got SIGCHLD for process 914 (umount)
    [ 219.200666] systemd[1]: Child 914 died (code=exited, status=32/n/a)
    [ 219.200669] systemd[1]: Child 914 belongs to var.mount
    [ 219.200673] systemd[1]: var.mount mount process exited, code=exited status=32
    [ 219.200681] systemd[1]: var.mount changed unmounting -> mounted
    [ 219.200685] systemd[1]: Job var.mount/stop finished, result=failed
    [ 219.200711] systemd[1]: Failed unmounting /var.
    [ 219.200737] systemd[1]: Stopping File System Check on /dev/disk/by-uuid/98691163-fffa-4321-984c-3ba237083524...
    [ 219.200763] systemd[1]: systemd-fsck@dev-disk-by\x2duuid-98691163\x2dfffa\x2d4321\x2d984c\x2d3ba237083524.service changed exited -> dead
    [ 219.200769] systemd[1]: Job systemd-fsck@dev-disk-by\x2duuid-98691163\x2dfffa\x2d4321\x2d984c\x2d3ba237083524.service/stop finished, result=done
    [ 219.200797] systemd[1]: Stopped File System Check on /dev/disk/by-uuid/98691163-fffa-4321-984c-3ba237083524.
    [ 219.200816] systemd[1]: Redirecting stop request from dev-disk-by\x2duuid-98691163\x2dfffa\x2d4321\x2d984c\x2d3ba237083524.device to sys-devices-virtual-block-dm\x2d6.device.
    [ 219.200823] systemd[1]: Stopping /sys/devices/virtual/block/dm-6.
    [ 219.200876] systemd[1]: Accepted connection on private bus.
    [ 219.201099] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 219.201186] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 219.201483] systemd[1]: Accepted connection on private bus.
    [ 219.201642] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 219.201716] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 219.204043] systemd[1]: Accepted connection on private bus.
    [ 219.204142] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 219.204219] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 219.234497] systemd[1]: dev-mapper-linux\x2dswap.swap changed active -> dead
    [ 219.234606] systemd[1]: Job dev-mapper-linux\x2dswap.swap/stop finished, result=done
    [ 219.234657] systemd[1]: Deactivated swap /dev/mapper/linux-swap.
    [ 219.234674] systemd[1]: dev-linux-swap.swap changed active -> dead
    [ 219.234751] systemd[1]: Job dev-linux-swap.swap/stop finished, result=done
    [ 219.234805] systemd[1]: Deactivated swap /dev/linux/swap.
    [ 219.234815] systemd[1]: dev-disk-by\x2did-dm\x2duuid\x2dLVM\x2dDevEGGWf3oc8GE2g06c6XaLVUQEgo9cTTSwqNIhBSQfWKqAKYdL5kKqo0rCZ38xZ.swap changed active -> dead
    [ 219.234970] systemd[1]: Job dev-disk-by\x2did-dm\x2duuid\x2dLVM\x2dDevEGGWf3oc8GE2g06c6XaLVUQEgo9cTTSwqNIhBSQfWKqAKYdL5kKqo0rCZ38xZ.swap/stop finished, result=done
    [ 219.235007] systemd[1]: Deactivated swap /dev/disk/by-id/dm-uuid-LVM-DevEGGWf3oc8GE2g06c6XaLVUQEgo9cTTSwqNIhBSQfWKqAKYdL5kKqo0rCZ38xZ.
    [ 219.235017] systemd[1]: dev-disk-by\x2did-dm\x2dname\x2dlinux\x2dswap.swap changed active -> dead
    [ 219.235097] systemd[1]: Job dev-disk-by\x2did-dm\x2dname\x2dlinux\x2dswap.swap/stop finished, result=done
    [ 219.235126] systemd[1]: Deactivated swap /dev/disk/by-id/dm-name-linux-swap.
    [ 219.235135] systemd[1]: dev-disk-by\x2duuid-f8b1e59e\x2d9804\x2d44f0\x2daf79\x2d66810ee49206.swap changed active -> dead
    [ 219.235214] systemd[1]: Job dev-disk-by\x2duuid-f8b1e59e\x2d9804\x2d44f0\x2daf79\x2d66810ee49206.swap/stop finished, result=done
    [ 219.235244] systemd[1]: Deactivated swap /dev/disk/by-uuid/f8b1e59e-9804-44f0-af79-66810ee49206.
    [ 219.235297] systemd[1]: Received SIGCHLD from PID 907 (swapoff).
    [ 219.235323] systemd[1]: Got SIGCHLD for process 907 (swapoff)
    [ 219.235390] systemd[1]: Child 907 died (code=exited, status=0/SUCCESS)
    [ 219.235394] systemd[1]: Child 907 belongs to dev-dm\x2d2.swap
    [ 219.235399] systemd[1]: dev-dm\x2d2.swap swap process exited, code=exited status=0
    [ 219.235410] systemd[1]: dev-dm\x2d2.swap changed deactivating -> dead
    [ 219.235956] systemd[1]: Job dev-dm\x2d2.swap/stop finished, result=done
    [ 219.236044] systemd[1]: Deactivated swap /dev/dm-2.
    [ 219.236131] systemd[1]: Got SIGCHLD for process 911 (umount)
    [ 219.236192] systemd[1]: Child 911 died (code=exited, status=0/SUCCESS)
    [ 219.236196] systemd[1]: Child 911 belongs to boot.mount
    [ 219.236201] systemd[1]: boot.mount mount process exited, code=exited status=0
    [ 219.236210] systemd[1]: boot.mount changed unmounting -> dead
    [ 219.236294] systemd[1]: Job boot.mount/stop finished, result=done
    [ 219.236322] systemd[1]: Unmounted /boot.
    [ 219.236360] systemd[1]: Received SIGCHLD from PID 911 (n/a).
    [ 219.236413] systemd[1]: Accepted connection on private bus.
    [ 219.236551] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 219.237196] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 219.237321] systemd[1]: Accepted connection on private bus.
    [ 219.237463] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 219.237814] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 219.238324] systemd[1]: Received SIGCHLD from PID 909 (umount).
    [ 219.238348] systemd[1]: Got SIGCHLD for process 909 (umount)
    [ 219.238404] systemd[1]: Child 909 died (code=exited, status=0/SUCCESS)
    [ 219.238407] systemd[1]: Child 909 belongs to storage.mount
    [ 219.238412] systemd[1]: storage.mount mount process exited, code=exited status=0
    [ 219.238420] systemd[1]: storage.mount changed unmounting -> dead
    [ 219.238509] systemd[1]: Job storage.mount/stop finished, result=done
    [ 219.238540] systemd[1]: Unmounted /storage.
    [ 219.238556] systemd[1]: Stopping Local File Systems (Pre).
    [ 219.238562] systemd[1]: local-fs-pre.target changed active -> dead
    [ 219.238566] systemd[1]: Job local-fs-pre.target/stop finished, result=done
    [ 219.238592] systemd[1]: Stopped target Local File Systems (Pre).
    [ 219.238604] systemd[1]: Stopping Remount Root and Kernel File Systems...
    [ 219.238627] systemd[1]: systemd-remount-fs.service changed exited -> dead
    [ 219.238631] systemd[1]: Job systemd-remount-fs.service/stop finished, result=done
    [ 219.238656] systemd[1]: Stopped Remount Root and Kernel File Systems.
    [ 219.238673] systemd[1]: Starting Shutdown.
    [ 219.238676] systemd[1]: shutdown.target changed dead -> active
    [ 219.238679] systemd[1]: Job shutdown.target/start finished, result=done
    [ 219.238703] systemd[1]: Reached target Shutdown.
    [ 219.239263] systemd[1]: Accepted connection on private bus.
    [ 219.239382] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 219.239752] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 219.630816] systemd[1]: Received SIGCHLD from PID 486 (at-spi-bus-laun).
    [ 219.630840] systemd[1]: Got SIGCHLD for process 486 (at-spi-bus-laun)
    [ 219.630896] systemd[1]: Child 486 died (code=exited, status=0/SUCCESS)
    [ 219.668697] systemd[1]: Received SIGCHLD from PID 449 (X).
    [ 219.668725] systemd[1]: Got SIGCHLD for process 449 (X)
    [ 219.668781] systemd[1]: Child 449 died (code=exited, status=0/SUCCESS)
    [ 219.669379] systemd[1]: Accepted connection on private bus.
    [ 219.669545] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 219.669606] systemd[1]: lightdm.service: cgroup is empty
    [ 219.669636] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 220.420041] systemd[1]: Received SIGCHLD from PID 845 (sleep).
    [ 220.420064] systemd[1]: Got SIGCHLD for process 845 (sleep)
    [ 220.420103] systemd[1]: Child 845 died (code=exited, status=0/SUCCESS)
    [ 221.914117] systemd[1]: Received SIGCHLD from PID 545 (dbus-launch).
    [ 221.914141] systemd[1]: Got SIGCHLD for process 545 (dbus-launch)
    [ 221.914184] systemd[1]: Child 545 died (code=exited, status=0/SUCCESS)
    [ 221.914458] systemd[1]: Received SIGCHLD from PID 483 (dbus-launch).
    [ 221.914486] systemd[1]: Got SIGCHLD for process 483 (dbus-launch)
    [ 221.914529] systemd[1]: Child 483 died (code=exited, status=0/SUCCESS)
    [ 221.915102] systemd[1]: Accepted connection on private bus.
    [ 221.915222] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 221.915328] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 223.957616] systemd[1]: Received SIGCHLD from PID 904 (systemd-cryptse).
    [ 223.957639] systemd[1]: Got SIGCHLD for process 904 (systemd-cryptse)
    [ 223.957707] systemd[1]: Child 904 died (code=exited, status=1/FAILURE)
    [ 223.957712] systemd[1]: Child 904 belongs to systemd-cryptsetup@crypt\x2dhome.service
    [ 223.957720] systemd[1]: systemd-cryptsetup@crypt\x2dhome.service: control process exited, code=exited status=1
    [ 223.957782] systemd[1]: systemd-cryptsetup@crypt\x2dhome.service got final SIGCHLD for state stop
    [ 223.957818] systemd[1]: systemd-cryptsetup@crypt\x2dhome.service changed stop -> failed
    [ 223.957904] systemd[1]: Job systemd-cryptsetup@crypt\x2dhome.service/stop finished, result=done
    [ 223.957917] systemd[1]: Stopped Cryptography Setup for crypt-home.
    [ 223.957928] systemd[1]: Unit systemd-cryptsetup@crypt\x2dhome.service entered failed state.
    [ 223.958243] systemd[1]: Accepted connection on private bus.
    [ 223.958397] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 223.958509] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 224.016365] systemd[1]: Received SIGCHLD from PID 905 (systemd-cryptse).
    [ 224.016390] systemd[1]: Got SIGCHLD for process 905 (systemd-cryptse)
    [ 224.016447] systemd[1]: Child 905 died (code=exited, status=1/FAILURE)
    [ 224.016451] systemd[1]: Child 905 belongs to systemd-cryptsetup@crypt\x2dlinux.service
    [ 224.016457] systemd[1]: systemd-cryptsetup@crypt\x2dlinux.service: control process exited, code=exited status=1
    [ 224.016529] systemd[1]: systemd-cryptsetup@crypt\x2dlinux.service got final SIGCHLD for state stop
    [ 224.016565] systemd[1]: systemd-cryptsetup@crypt\x2dlinux.service changed stop -> failed
    [ 224.016661] systemd[1]: Job systemd-cryptsetup@crypt\x2dlinux.service/stop finished, result=done
    [ 224.016676] systemd[1]: Stopped Cryptography Setup for crypt-linux.
    [ 224.016687] systemd[1]: Unit systemd-cryptsetup@crypt\x2dlinux.service entered failed state.
    [ 224.016703] systemd[1]: Starting Unmount All Filesystems.
    [ 224.016707] systemd[1]: umount.target changed dead -> active
    [ 224.016711] systemd[1]: Job umount.target/start finished, result=done
    [ 224.016717] systemd[1]: Reached target Unmount All Filesystems.
    [ 224.016728] systemd[1]: Starting Final Step.
    [ 224.016731] systemd[1]: final.target changed dead -> active
    [ 224.016734] systemd[1]: Job final.target/start finished, result=done
    [ 224.016742] systemd[1]: Reached target Final Step.
    [ 224.016754] systemd[1]: Starting Reboot...
    [ 224.016866] systemd[1]: About to execute: /usr/bin/systemctl --force reboot
    [ 224.017057] systemd[1]: Forked /usr/bin/systemctl as 928
    [ 224.017193] systemd[1]: systemd-reboot.service changed dead -> start
    [ 224.018230] systemd[928]: Executing: /usr/bin/systemctl --force reboot
    [ 224.018328] systemd[1]: Accepted connection on private bus.
    [ 224.018435] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
    [ 224.018504] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
    [ 224.019495] systemd[1]: Accepted connection on private bus.
    [ 224.019712] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Manager.Reboot() on /org/freedesktop/systemd1
    [ 224.019734] systemd[1]: Shutting down.
    [ 224.023022] systemd[1]: Hardware watchdog 'NV_TCO', version 0
    [ 224.023031] systemd[1]: Failed to set timeout to 600s: Invalid argument
    [ 224.023033] nv_tco: Unexpected close, not stopping watchdog!
    [ 225.162099] systemd-journald[215]: Received SIGTERM
    [ 225.515048] EXT4-fs (dm-6): re-mounted. Opts: (null)
    [ 225.687382] EXT4-fs (dm-4): re-mounted. Opts: (null)
    [ 225.796081] EXT4-fs (dm-3): re-mounted. Opts: (null)
    [ 225.915129] EXT4-fs (dm-1): re-mounted. Opts: (null)
    [ 225.919881] EXT4-fs (dm-1): re-mounted. Opts: (null)
    [ 225.919911] EXT4-fs (dm-1): re-mounted. Opts: (null)
    [ 226.283469] EXT4-fs (dm-1): re-mounted. Opts: data=ordered

  • [invalid] Run systemd service after specific device is initialized

    Hi.
    Is there any way to run systemd service only after specific device is initialized/kernel module is loaded?
    The task I'm trying to solve is applying trackpoint speed and sensitivity settings on boot in my X220.
    Service code (trackpoint.service) is quite simple
    [Unit]
    Description=Trackpoint configuration
    [Service]
    Type=oneshot
    EnvironmentFile=/etc/conf.d/trackpoint.conf
    ExecStart=/bin/sh -c 'echo ${sensitivity} > /sys/devices/platform/i8042/serio1/serio2/sensitivity'
    ExecStart=/bin/sh -c 'echo ${speed} > /sys/devices/platform/i8042/serio1/serio2/speed'
    [Install]
    WantedBy=graphical.target
    The issue is that trackpoint.service gets executed before trackpoint device gets initialized and thus fails.
    Jun 14 23:12:10 xi sh[414]: /bin/sh: /sys/devices/platform/i8042/serio1/serio2/sensitivity: No such file or directory
    Jun 14 23:12:10 xi systemd[1]: Unit trackpoint.service entered failed state.
    Jun 14 23:12:18 xi kernel: psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 3/3
    Jun 14 23:12:18 xi kernel: input: TPPS/2 IBM TrackPoint as /devices/platform/i8042/serio1/serio2/input/input13
    What have I tried already
    1. Specified systemd-modules-load in After= and Requires= directives and added psmouse module to /etc/modules-load.d
    2. Tried path activation (perhaps, I did it wrong) by creating i8042.path
    [Path]
    PathExists=/sys/devices/platform/i8042
    Unit=trackpoint.service
    However, this changed nothing.
    I don't know what else should I try.
    Please suggest solution for this.
    Thanks in advance.
    Last edited by eDio (2013-06-15 13:28:36)

    Thank you very much.
    I've finally managed this to work
    $ cat /etc/udev/rules.d/10-trackpoint.rules
    SUBSYSTEM=="input", KERNEL=="event13", ACTION=="add", RUN+="/usr/bin/trackpoint_apply"
    $ cat /etc/conf.d/trackpoint.conf
    speed=255
    sensitivity=255
    $ cat /usr/bin/trackpoint_apply
    #!/usr/bin/env sh
    . /etc/conf.d/trackpoint.conf
    /usr/bin/echo $speed > /sys/devices/platform/i8042/serio1/serio2/sensitivity
    /usr/bin/echo $sensitivity > /sys/devices/platform/i8042/serio1/serio2/speed

  • [SOLVED] Cannot migrate to encrypted home partition

    So I installed Arch to play around and familiarise myself with, and I'd now like to use it full time. My company require that either home dir or full disk encryption is used, so I need to migrate my home directory using ecryptfs. Followed the wiki (created a test user to break first though), but it fails as lsof seems to see its own process checking for open files as an open file: cue much
    INFO: Checking disk space, this may take a few moments. Please be patient.
    INFO: Checking for open files in /home/shw
    INFO: The following files are in use:
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    systemd 1 root 19r FIFO 0,8 0t0 8339 pipe
    lsof 428 root 1w FIFO 0,8 0t0 10969 pipe
    lsof 428 root 4w FIFO 0,8 0t0 9076 pipe
    lsof 428 root 5r FIFO 0,8 0t0 9077 pipe
    sed 429 root 0r FIFO 0,8 0t0 10969 pipe
    lsof 430 root 3r FIFO 0,8 0t0 9076 pipe
    lsof 430 root 6w FIFO 0,8 0t0 9077 pipe
    ERROR: Cannot proceed.
    Any suggestions?
    Last edited by analbeard (2014-11-20 08:24:39)

    I will give it try tomorrow and inform you about the outcome. I will use the guide  by anarxc http://sysphere.org/~anrxc/j/articles/e … index.html
    Just to complete the information. When I logged in as root, (right after the boot) I got this
    [root@notebook ~]$ ecryptfs-migrate-home -u user
    INFO: Checking disk space, this may take a few moments. Please be patient.
    INFO: Checking for open files in /home/shw
    INFO: The following files are in use:
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    systemd 1 root 22r FIFO 0,8 0t0 1196 pipe
    systemd 1 root 23u FIFO 0,15 0t0 1198 /run/dmeventd-server
    systemd 1 root 24u FIFO 0,15 0t0 1199 /run/dmeventd-client
    systemd 1 root 26u FIFO 0,15 0t0 1203 /run/systemd/initctl/fifo
    NetworkMa 258 root 20w FIFO 0,15 0t0 10093 /run/systemd/inhibit/1.ref
    systemd-l 260 root 19r FIFO 0,15 0t0 10093 /run/systemd/inhibit/1.ref
    systemd-l 260 root 26r FIFO 0,15 0t0 14800 /run/systemd/sessions/c2.ref
    login 527 root 6w FIFO 0,15 0t0 14800 /run/systemd/sessions/c2.ref
    ecryptfs- 669 root 1w FIFO 0,8 0t0 16695 pipe
    tee 670 root 0r FIFO 0,8 0t0 16695 pipe
    lsof 692 root 1w FIFO 0,8 0t0 16798 pipe
    lsof 692 root 4w FIFO 0,8 0t0 15619 pipe
    lsof 692 root 5r FIFO 0,8 0t0 15620 pipe
    sed 693 root 0r FIFO 0,8 0t0 16798 pipe
    sed 693 root 1w FIFO 0,8 0t0 16695 pipe
    lsof 694 root 3r FIFO 0,8 0t0 15619 pipe
    lsof 694 root 6w FIFO 0,8 0t0 15620 pipe
    ERROR: cannot proceed
    Last edited by macaco (2014-11-17 23:43:45)

  • [SOLVED] Launching systemd service as non-root user

    I need to launch a systemd service as a non-root user. I've looked at this but I'm fairly confused. I don't have xorg or any desktop environment installed (this is a remote server I SSH into) but when I run
    systemctl --user status
    I get
    Failed to get D-Bus connection: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
    What am I doing wrong?
    Last edited by gsingh93 (2013-12-01 07:29:29)

    I was going in the wrong direction. All I had to do was add 'User=username' and 'Group=groupname' in the [Service] section.

  • [solved] writing systemd service file to run script

    i have completely migrated to systemd. now, i am trying to write a service file to run a startup script (~/.startup.sh). one of the functions of the script is to set the brightness of the screen:
    echo "95" > /sys/class/backlight/intel_backlight/brightness
    i created /etc/systemd/system/startup.service:
    [Unit]
    Description=Run startup script
    [Service]
    Type=oneshot
    ExecStart=~/.startup.sh
    [Install]
    WantedBy=multi-user.target
    but i get the following error:
    Failed to issue method call: Unit startup.service failed to load: Invalid argument. See system logs and 'systemctl status startup.service' for details.
    i have two questions:
    1. what am i missing?
    2. how can i avoid permission issues associated with modifying the brightness file (e.g., permission denied errors, the need to put in the password, etc.)?
    thanks.
    Last edited by anti-destin (2012-08-01 22:26:04)

    thanks for the replies.
    just a note: using an absolute path didn't fix the issue.
    but i went ahead and created the file /etc/tmpfiles.d/backlight.conf:
    w /sys/class/backlight/intel_backlight/brightness - - - - 95
    and that worked.
    is there a reason for recommending using a tmpfile rather than a service?
    in any case, i'm marking this as solved.

  • [solved] Writing systemd service file - forking no pidfile

    Hey all,
    I am trying to write .service files for TORQUE, but am having some difficulty and quite can't understand the docs.  Here's what I have so far for the server
    [Unit]
    Description=TORQUE server
    Wants=basic.target
    After=basic.target network.target
    [Service]
    Type=forking
    PIDFile=/run/torque-server.pid
    ExecStart=/usr/sbin/pbs_server
    [Install]
    WantedBy=multi-user.target
    The problem I'm having is with the PIDFile - pbs_server doesn't provide an option (as far as I can see) to specify a pid file... is this something that systemd can generate on its own, or what's the normal solution here?
    Without the PIDFile specified systemctl start returns immediately and no process exists, with the PIDFile systemctl start stalls for a while and then has an error saying it couldn't find the pid file (surprise), but pbs_server is left running.
    Thanks for any help
    Last edited by dandaman0061 (2012-12-13 19:58:36)

    Nevermind - it appears that pbs_server creates a pid file at $TORQUE_HOME/server_priv/server.lock where using torque from the AUR is /var/spool/torque
    Chaging the pidfile setting in the service file to this now works.

  • [SOLVED] Dovecot Systemd Service Fails

    Hello all, I can't find the reason for why my dovecot fails. My journalctl doesn't provide output for the PID I give it.
    $ systemctl status dovecot.service
    * dovecot.service - Dovecot IMAP/POP3 email server
    Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled)
    Active: failed (Result: exit-code) since Mon 2014-08-04 17:53:27 UTC; 1min 4s ago
    Process: 4580 ExecStart=/usr/bin/dovecot -F (code=exited, status=89)
    Main PID: 4580 (code=exited, status=89)
    $ journalctl -b _PID=4580
    -- Logs begin at Fri 2013-03-29 01:07:20 UTC, end at Mon 2014-08-04 02:50:51 UTC. --
    Thank you for the help.
    ========================
    EDIT:
    ran the process described above: dovecot -F which gave me the dovecot error message. I had a misconfigured file (spelling mistake).
    Thanks for the help!
    Last edited by lexan (2014-08-04 18:11:28)

    Padfoot wrote:
    Try the following:
    [Unit]
    Description=K Display Manager
    Conflicts=[email protected]
    After=systemd-user-sessions.service [email protected]
    [Service]
    ExecStart=/usr/bin/kdm -nodaemon
    Restart=always
    IgnoreSIGPIPE=no
    StandardOutput=syslog
    [Install]
    Alias=display-manager.service
    Thank you for your suggestion. Unfortunately it does not work. Out of 4 boots, 3 time I ended up with blank screen. Interestingly, in the last boot I was able to switch to tty1 just after screen went blank and managed to log in to tty. I've restarted the kdm.service then manually in hope the image will be restored, but it wasn't. The restart of kdm then made the screen totally blank and I was unable to switch to tty anymore.
    Is it possible that radeon module in kernel has some slow initialization procedure and if X requires its services before it is properly initialized it ends up with blank screen?

  • [Solved] custom systemd service error: Error spawning dbus-launch

    Hello!
    I wroted a shell script to change gnome background
    gsettings set org.gnome.desktop.background picture-uri "/tmp/wallpaper.jpg"
    After that i wrote a systemd wall.service file to launch it
    [Unit]
    Description=Change wallpaper
    After=gdm.service
    [Service]
    Type=oneshot
    ExecStart=test.sh
    [Install]
    WantedBy=graphical.target
    When i try systemctl start wall.service, nothing happens and systemctl status wall.service gives me
    dconf-WARNING **: failed to commit changes to dconf: Error spawning command line 'dbus-launch --autolaunch=74d66c08eacb4e12a2219f3fe74c245b --binary-syntax --close-stderr': Child process exited with code 1
    Where the problem hides?
    Last edited by anptr (2014-06-12 18:08:17)

    tomk wrote:Not a gnome user myself, but if I wanted something to change the wallpaper in my Openbox setup I wouldn't involve systemd at all. I would have thought gnome would have some utility for this built-in, but if not use nitrogen, feh, or other such tools.
    This.
    Really, you are just trying to make things overly complex.  But I was just trying to tell you how to achieve your goal along the path you were taking.  I too wouldn't involve systemd for such a task.  The advantages that systemd provides just aren't necessary for such a process.
    Edit: Besides that, I think you would have to specify the $DISPLAY as well somewhere in that setup.  Either in the service file or the script you wrote.
    Last edited by WonderWoofy (2014-06-08 15:49:01)

  • [SOLVED] mounting a plain dm-crypt encrypted partition

    After I botched an upgrade today, I'd like to save some stuff from an encrypted /home partition and start over.  I'm trying to mount the partition from a LiveCD and can't figure out what I'm doing wrong.
    [root@archiso ~]# cryptsetup create home /dev/sda3
    Enter passphrase:
    [root@archiso ~]# mount /dev/mapper/home /media/home
    [ 215.550259] SQUASHFS error: Can't find a SQUASHFS superblock on dm-3
    [ 215.566713] EXT4-fs (dm-3): unable to read superblock
    [ 215.580030] EXT2-fs (dm-3): error: unable to read superblock
    I don't think there's anything wrong with the partition, it was working fine earlier today, and from what I've read I think I'm trying to unlock and mount it correctly.  The only similar post I could find was this, but couldn't find any older install media to test with aside from dead torrents and I'm not sure what version of dm-crypt was used to create the partition.
    Last edited by bnjw (2011-12-29 10:26:11)

    It's ext3, and I think I did use LUKS after all.  It looks like I just had the wrong drive name, after running blkid /dev/sda3 wasn't even listed, but /dev/sda9 matched it in capacity.  Using that instead I was able to cryptsetup luksOpen /dev/sda9 home and mount /dev/mapper/home /media/home worked fine afterward.  I have no idea what I was doing when I made this setup, but I'll pay attention when doing it this time (and not wait 6 months to -Syu and break everything).
    Thanks to both of you for the help.

  • [SOLVED] Trouble with running systemd user service on login

    I'm trying to get emacs to run as a systemd/user service so that it will start up faster, as suggested in the wiki article, but I'm having some problems.
    I can't get the service to run as soon as I log in. I can run the service with
    systemctl --user start emacs
    and it will run for the rest of my session, but if I try to run
    systemctl --user enable emacs
    I get the following error:
    The unit files have no [Install] section. They are not meant to be enabled
    using systemctl.
    Possible reasons for having this kind of units are:
    1) A unit may be statically enabled by being symlinked from another unit's
    .wants/ or .requires/ directory.
    2) A unit's purpose may be to act as a helper for some other unit which has
    a requirement dependency on it.
    3) A unit may be started when needed via activation (socket, path, timer,
    D-Bus, udev, scripted systemctl call, ...).
    I ran
    systemctl --user is-enabled emacs
    and that returned
    static
    but I'm not sure what that means. Any help would be greatly appreciated.
    Last edited by whitebrice (2014-06-28 17:20:13)

    Are you sure there isn't a typo in your unit file? The example you linked to in the wiki does have an [Install] section.
    Post your ~/.config/systemd/user/emacs.service file here so we can take a look.

  • [SOLVED] Run kded as a separate (systemd?) service

    Hi.
    I'm currently trying to enrich wmii session with some kde features.
    For example to allow kde to manage my keyboard I can do
    $ kded4
    $ qdbus org.kde.kded /kded loadModule keyboard
    The issue is that I can't start kded on login. I've tried both .xinitrc and systemd way. The outcome is always the same: kded4 won't work for the first time. There are 4 processes of kded4 and none of them responds to dbus calls. However, killing out all of its processes and starting again results in kded4 behaving correctly.
    So, here what I have currently
    systemd service
    [Unit]
    Description=KDE daemon
    [Service]
    ExecStart=/usr/bin/kded4
    [Install]
    WantedBy=workspace.target
    After an attempt to start
    $ systemctl --user status kded
    kded.service - KDE daemon
    Loaded: loaded (/home/edio/.config/systemd/user/kded.service; disabled)
    Active: active (running) since Sat 2013-03-09 19:39:40 EET; 1s ago
    Main PID: 25887 (kded4)
    CGroup: name=systemd:/user/edio/4/systemd-25706/kded.service
    ├─25887 /usr/bin/kded4
    ├─25895 /usr/bin/kded4
    ├─25900 /usr/bin/kdeinit4 --suicide
    ├─25901 /usr/bin/kdeinit4 --suicide
    ├─25902 kdeinit4: klauncher [kdeinit] --fd=8
    └─25904 kdeinit4: kded4 [kdeinit]
    Mar 09 19:39:40 xi systemd[25706]: Starting KDE daemon...
    Mar 09 19:39:40 xi systemd[25706]: Started KDE daemon.
    Mar 09 19:39:40 xi kded4[25887]: QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Mar 09 19:39:40 xi kded4[25887]: QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Mar 09 19:39:40 xi kded4[25887]: QGtkStyle was unable to detect the current GTK+ theme.
    Mar 09 19:39:40 xi kded4[25887]: Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
    Mar 09 19:39:40 xi kded4[25887]: QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Mar 09 19:39:40 xi kded4[25887]: KDE Daemon (kded) already running.
    Mar 09 19:39:40 xi kded4[25887]: QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Has anyone tried that already? Any ideas, how to start kded4?
    Thanks in advance.
    Last edited by eDio (2013-03-10 21:11:00)

    I finally managed this to work.
    Results of this are available on github.
    Let me know please, if you think this info is worth a wiki page or a dedicated topic.
    https://github.com/edio/systemd-kdemodules

  • [SOLVED] defect dbus service, systemd is unable to create socket

    Hi,
    I am experiencing serious problems with systemd & dbus.
    I want to setup a gateway in a KVM VM, all was working fine till i applied my shorewall config & set to autostart (systemctl enable shorewall).
    If I reboot the machine after this step one or two times, then I get a broken dbus service.
    What I did than: reinstalled archlinux again (x86_x64) and setup same -> got issue again.
    installed arch linux as x86 and setup same -> issue again
    installed arch as x86 and configured nothing else shorewall and got this issue again after maximum of two reboots.
    i found in log:
    Feb 13 15:45:56 pactor systemd[1]: Failed to open private bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
    I've checked this directory by hand and found that only /var/run is existing. /var/run/dbus is already not existing.
    logs:
    journalctl -b: http://nopaste.info/685f4c6192.html
    -be aware of systemd-logind, this needs dbus and i experience same problem with other services which require dbus as dnsmasq
    root@pactor ~]# systemctl status dbus
    dbus.service - D-Bus System Message Bus
    Loaded: loaded (/usr/lib/systemd/system/dbus.service; static)
    Active: active (running) since Mi 2013-02-13 15:45:56 CET; 9min ago
    Main PID: 169 (dbus-daemon)
    CGroup: name=systemd:/system/dbus.service
    └─169 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
    [root@pactor ~]# systemctl status dbus.socket
    dbus.socket - D-Bus System Message Bus Socket
    Loaded: loaded (/usr/lib/systemd/system/dbus.socket; static)
    Active: active (running) since Mi 2013-02-13 15:45:56 CET; 9min ago
    Feb 13 15:45:56 pactor systemd[1]: Listening on D-Bus System Message Bus Socket.
    systemd-logind.service - Login Service
    Loaded: loaded (/usr/lib/systemd/system/systemd-logind.service; static)
    Active: activating (start) since Mi 2013-02-13 16:00:56 CET; 48s ago
    Docs: man:systemd-logind.service(8)
    man:logind.conf(5)
    http://www.freedesktop.org/wiki/Software/systemd/multiseat
    Main PID: 338 (systemd-logind)
    CGroup: name=systemd:/system/systemd-logind.service
    └─338 /usr/lib/systemd/systemd-logind
    Feb 13 16:00:56 pactor systemd[1]: Failed to start Login Service.
    Feb 13 16:00:56 pactor systemd[1]: Unit systemd-logind.service entered failed state
    Feb 13 16:00:56 pactor systemd[1]: systemd-logind.service holdoff time over, scheduling restart.
    Feb 13 16:00:56 pactor systemd[1]: Stopping Login Service...
    Feb 13 16:00:56 pactor systemd[1]: Starting Login Service...
    installed packages: http://nopaste.info/1d1be9adad.html
    shorewall config: shorewall_conf.tar
    Last edited by debijan (2013-02-20 20:13:47)

    oh man... found the reason due to help of some guys on systemd irc... big thx to falconindy and alxchk.
    shorewall's SUBSYSLOCK option in shorewall.conf is by default set to /var/lock/shorewall.
    but the arch wiki point that it should be set to /var/run: https://wiki.archlinux.org/index.php/Router
    definitely wrong! that deletes the /var/run symlink and created a directory intstead.
    to set the SUBSYSLOCK on default is working like a charm.
    look also for this: https://bbs.archlinux.org/viewtopic.php?id=151285
    could somebody modify the wiki in the meantime, i will hold this thread on -not-solved in the meantime
    edit:/ oh man this wrong info in wiki did cost me a lot of time :-/
    Last edited by debijan (2013-02-13 22:09:35)

  • Getting sasc-ng to work properly with systemd service files [SOLVED]

    This thread is intended for getting the following AUR packages to work with each other with systemd service scripts:
    https://aur.archlinux.org/packages/open-sasc-ng-dkms/
    https://aur.archlinux.org/packages/open-sasc-ng/
    https://aur.archlinux.org/packages/oscam-svn/   (this is a related package as it must properly execute prior to sasc-ng)
    So my server is now on a fresh Arch install with systemd. All is well (& very fast) except I cannot get sasc-ng to function with systemd service init files. Prior to systemd the system worked fine with the rc initscripts & was very stable with the following setup:
    rc.local
    /etc/rc.d/oscam start
    sleep 15
    /etc/rc.d/sasc-ng start
    sleep 4
    /etc/rc.d/mythbackend start
    /etc/conf.d/sasc-ng.conf
    SASCNG_ARGS="-j 0:3 -j 1:4 -j 2:5" -b 16M --sid-allpid --sid-nocache --cam-budget"
    DVBLOOPBACK_ARGS="num_adapters=3"
    LOGDIR="/home/mythtv/logs/"
    CAMDIR="/etc/camdir"
    /etc/camdir/cardclient.conf
    camd35:localhost:15050:1/0000/0000:mythtv:mythtv
    I'll leave out the oscam stuff as that loads fine and doesn't appear to be a part of the problem
    I've tried this with the systemd service file that comes with the open-sasc-ng-dkms package and when it was not sucessful I tried a bunch of variants including using "Type=simple" ect. "Type=Forked" seems to be only option that actually tries to start the processes. I also "hardcoded" the service files for the 2 sasc-ng components to find a few issues with the EnvironmentFile variables. The log variable has been removed for now as this seems to cause a fatal error but the rest of the variables load fine now. I also tested spliting up the DVB loopback module from the sasc-ng binary but this also gives similar results as the following script stands now. Running them manually with systemctl start commands doesn't make a difference but that is not surprising. The service file I'm fiddling with now which I feel has the best potential become working is:
    sasc-ng.service
    [Unit]
    Description=Sasc-ng
    After=oscam.service
    [Service]
    Type=forking
    EnvironmentFile=/etc/conf.d/sasc-ng
    ExecStartPre=/sbin/modprobe dvbloopback $DVBLOOPBACK_ARGS
    TimeoutSec=2
    ExecStart=/usr/sbin/sasc-ng -D $SASCNG_ARGS --cam-dir=$CAMDIR
    TimeoutSec=4
    [Install]
    WantedBy=multi-user.target
    Mythbackend always runs fine (even without DTV via sasc-ng) with the following mythbackend.service:
    [Unit]
    Description=MythTV_backend
    After=sasc-ng.service
    [Service]
    Type=simple
    Environment=MYTHCONFDIR=/etc/conf.d/mythbackend
    Environment=HOME=/usr/share/mythtv
    User=mythtv
    ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv
    [Install]
    WantedBy=multi-user.target
    oscam.service taken mostly from AUR package also seems fine. I added the TimeoutSec=15 to give time for oscam to load the SC and client protocol before moving on or else sasc-ng fails
    Unit]
    Description=An Open Source Conditional Access Module software
    After=network.target
    [Service]
    Type=forking
    EnvironmentFile=/etc/conf.d/oscam
    ExecStart=/usr/bin/oscam $OSCAM_ARGS
    TimeoutSec=15
    [Install]
    WantedBy=multi-user.target
    Below is the output of the systemctl status commands. Despite the noise in the sasc-ng binary status, it is the loopback module that is " inactive (dead)" and there are no virtual DVB devices being created:
    [mythtv@server ~]$ sudo systemctl status oscam.service
    oscam.service - An Open Source Conditional Access Module software
    Loaded: loaded (/usr/lib/systemd/system/oscam.service; enabled)
    Active: active (running) since Tue, 2012-11-27 21:10:17 CET; 1min 7s ago
    Process: 338 ExecStart=/usr/bin/oscam $OSCAM_ARGS (code=exited, status=0/SUCCESS)
    Main PID: 377 (oscam)
    CGroup: name=systemd:/system/oscam.service
    ├ 377 /usr/bin/oscam -b -c /etc/oscam
    └ 378 /usr/bin/oscam -b -c /etc/oscam
    Nov 27 21:10:17 server systemd[1]: Started An Open Source Conditional Acces...e.
    [mythtv@server ~]$ sudo systemctl status loopback.service
    loopback.service - Sasc-ng DVB Loopback Module
    Loaded: loaded (/etc/systemd/system/loopback.service; enabled)
    Active: inactive (dead) since Tue, 2012-11-27 21:10:28 CET; 1min 27s ago
    Process: 907 ExecStart=/sbin/modprobe dvbloopback num_adapters=3 (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/loopback.service
    Nov 27 21:10:28 server systemd[1]: Started Sasc-ng DVB Loopback Module.
    [mythtv@server ~]$ sudo systemctl status sasc-ng.service
    sasc-ng.service - Sasc-ng
    Loaded: loaded (/etc/systemd/system/sasc-ng.service; enabled)
    Active: failed (Result: exit-code) since Tue, 2012-11-27 21:10:47 CET; 1min 45s ago
    Process: 913 ExecStart=/usr/sbin/sasc-ng -D -j 0:3 -j 1:4 -j 2:5" -b 16M --sid-allpid --sid-nocache --cam-budget --cam-dir=/etc/camdir -l /home/mythtv/logs/sasc-ng.log (code=exited, status=0/SUCCESS)
    Main PID: 921 (code=exited, status=255)
    CGroup: name=systemd:/system/sasc-ng.service
    Nov 27 21:10:39 server sasc-ng[921]: [921] [general.error] failed open /etc...ry
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc...ry
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc...ry
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.info] loading cardclien...nf
    Nov 27 21:10:42 server sasc-ng[921]: [1062] Netwatcher thread started (pid=...6)
    Nov 27 21:10:42 server sasc-ng[921]: [921] [general.error] no keys loaded f...m!
    Nov 27 21:10:46 server sasc-ng[921]: [1098] SC housekeeper thread started (...2)
    Nov 27 21:10:47 server sasc-ng[921]: [1062] Netwatcher thread ended (pid=92...6)
    Nov 27 21:10:47 server systemd[1]: sasc-ng.service: main process exited, co.../a
    Nov 27 21:10:47 server systemd[1]: Unit sasc-ng.service entered failed state
    [mythtv@server ~]$ sudo systemctl status sasc-ng.service
    sasc-ng.service - Sasc-ng
    Loaded: loaded (/etc/systemd/system/sasc-ng.service; enabled)
    Active: failed (Result: exit-code) since Tue, 2012-11-27 21:10:47 CET; 2min 9s ago
    Process: 913 ExecStart=/usr/sbin/sasc-ng -D -j 0:3 -j 1:4 -j 2:5" -b 16M --sid-allpid --sid-nocache --cam-budget --cam-dir=/etc/camdir -l /home/mythtv/logs/sasc-ng.log (code=exited, status=0/SUCCESS)
    Main PID: 921 (code=exited, status=255)
    CGroup: name=systemd:/system/sasc-ng.service
    Nov 27 21:10:39 server sasc-ng[921]: [921] [general.error] failed open /etc/camdir/smartcard.conf: No such file or directory
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc/camdir/cardslot.conf: No such file or directory
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc/camdir/SoftCam.Key: No such file or directory
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.info] loading cardclient config from /etc/camdir/cardclient.conf
    Nov 27 21:10:42 server sasc-ng[921]: [1062] Netwatcher thread started (pid=921, tid=140074379712256)
    Nov 27 21:10:42 server sasc-ng[921]: [921] [general.error] no keys loaded for softcam!
    Nov 27 21:10:46 server sasc-ng[921]: [1098] SC housekeeper thread started (pid=921, tid=140074371319552)
    Nov 27 21:10:47 server sasc-ng[921]: [1062] Netwatcher thread ended (pid=921, tid=140074379712256)
    Nov 27 21:10:47 server systemd[1]: sasc-ng.service: main process exited, code=exited, status=255/n/a
    Nov 27 21:10:47 server systemd[1]: Unit sasc-ng.service entered failed state
    [mythtv@server ~]$
    Any ideas?
    Last edited by wdirksen (2012-12-10 19:54:43)

    After some head scratching it seems to be all good now. Considering there have been no replies to this I've come to wonder if I might be the only one with this issue. I could get it working somewhat using service files but never ideal, ex. sasc-ng only using a few of the entitlements from oscam because it started too quick etc. Anyway this might help a few and I'm hoping the linux savvy who find what I'm writing here painfully newbie like or flawed will reply and educate me a bit if what's provided here needs some sharpening up:
    1) Systemd was confusing the sasc-ng binary shorthand arguments with Linux init arguments and a few were misinterpreted if they were not nested into the environment specifiers. So the -l (log) was causing problems and -b (buffer) wasn't loading. To be safe I'm using only the sasc-ng longhand specifiers from now on (two "--" and more verbose) so that they can never be confused even if safely nested in an environment parameter. That means that /etc/conf.d/sasc-ng will also need to be changed to reflect this. I also decided to simplify the LOGFILE parameter to include the whole argument syntax.
    2) Oscam.service needs to be initiated with oneshot and RemainAfterExit=yes to make sure the delay (15 seconds in my config) gets counted out before sasc-ng initiates.
    [EDIT 12/12/2012: Initially I had a second TimeoutSec=2 after ExecStart in sasc-ng.service but this had no function. Turns out that it almost always does work without this delay but not always with my setup. Adding TimeoutSec=2 to mythbackend.service prior to ExecStart command does function and makes things init more consistant]
    sasc-ng.service
    [Unit]
    Description=Sasc-ng
    After=oscam.service
    [Service]
    Type=simple
    EnvironmentFile=/etc/conf.d/sasc-ng
    ExecStartPre=/sbin/modprobe dvbloopback $DVBLOOPBACK_ARGS
    TimeoutSec=2
    ExecStart=/usr/sbin/sasc-ng $SASCNG_ARGS --cam-dir $CAMDIR --log $LOGFILE
    [Install]
    WantedBy=multi-user.target
    /etc/conf.d/sasc-ng
    SASCNG_ARGS="--join 0:3 --join 1:4 --join 2:5 --buffer 16M --sid-allpid --sid-nocache --cam-budget"
    DVBLOOPBACK_ARGS="num_adapters=3"
    LOGFILE="/home/mythtv/logs/sasc-ng.log"
    CAMDIR="/etc/camdir"
    oscam.service
    [Unit]
    Description=An Open Source Conditional Access Module software
    After=network.target
    [Service]
    Type=oneshot
    EnvironmentFile=/etc/conf.d/oscam
    ExecStart=/usr/bin/oscam $OSCAM_ARGS
    TimeoutSec=15
    RemainAfterExit=yes
    [Install]
    WantedBy=multi-user.target
    mythbackend.service
    [Unit]
    Description=MythTV_backend
    After=sasc-ng.service
    [Service]
    Type=simple
    TimeoutSec=2
    Environment=MYTHCONFDIR=/etc/conf.d/mythbackend
    Environment=HOME=/usr/share/mythtv
    User=mythtv
    ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv
    [Install]
    WantedBy=multi-user.target
    I will make the related changes to the open-sasc-ng AUR package which I currently maintain
    Last edited by wdirksen (2012-12-23 14:40:43)

  • [solved] how to easy encrypt HOME\USER folder?

    Hi Amigos!
    Can somone give me easy step by step guide how to easy encrypt home directory in Linux Arch please?
    I spent all day to try encrypt home directory (how I did it before in Debian) I used encyptfs-migrate-home -u [myusername] but after all encyption finished I'm unable to login to KDE to complete encyptfs-unwrap-passphrase script. I got error when KDE runing from xserver: call to lnusertemp failed (temporary directories full?)
    Realy approciate your help.
    Sławek
    Last edited by infoslaw (2013-08-09 20:17:44)

    mellowmaroon wrote:
    Here are some links to Arch Linux's great documentation:
    dm-crypt with LUKS
    Disk Encryption
    I found those two to be immensely helpful in learning about encryption on Arch Linux.
    Although it looks like you might actually want this (ECryptfs ArchWiki).  I use the dm-crypt/LUKS method, but the ArchWiki for ECryptfs looks like it has a good amount of info.
    Just as a heads up, be sure to search the ArchWiki thoroughly and look up what you're trying to do in general (encryption) first when you're trying to solve a problem.  The ArchWiki is very detailed and helpful.
    Thank you! Can I encrypt by use dm-crypt/LUKS method whole particion in few steps? Do you know does posible to clone hdd after full encryption?
    Regards,
    Sławek

Maybe you are looking for

  • Cannot invite attendees to iCal event in iCal 5.0 on new MacOSX lion?

    Hi there, Background: I have two gmail calendars snyced with the new iCal 5.0 on MacOsx Lion. Problem: When creating an event, I cannot add anybody to the event. The attendee field is just nonexistant. If I drag and drop a business card into iCal a n

  • Some queries on Data Guard design

    Hi, I have some basic questions around Data Guard design Q1. Looking at the Oracle instructions for creating a logical standby, it firstly advocates creating a physical standby and then converting it to a logical standby. However I thought a logical

  • I have lost some of purchased movies on my iPad but are still in my iTunes, how do I get them back on the iPad?

    I have lost some of purchased movies on my iPad but are still in my iTunes, how do I get them back on the iPad?

  • Connector params for ABAP Sneak peview

    Hi, I am trying to create a System in Portal ( Sneak Preview 7.0) to connect to NW ABAP Sneak Preview 2004 which is installed in the same machine. I created a 'SAP Dedicated application server' system and created an alias. When I do the Connection te

  • Career Change - Question

    Hello. Cut & Dry. Network Administrator at a defense company for 4.5 years. Exposure to sql 2000 for roughly 2 years. Received an opportunity at a globally known company. Now working in an area with opportunity given, to study/learn/work in an enviro