「セッションの停止」…「ユーザー」… 前にシステムサービスを停止および停止するにはどうすればよいですか?

「セッションの停止」…「ユーザー」… 前にシステムサービスを停止および停止するにはどうすればよいですか?

私は次のようなものを見る:

[  181.919605] preshutdown[3874]: Starting /home/ctor/bin/preshutdown
[  181.920611] crond[3284]: (CRON) INFO (Shutting down)
[  181.931087] systemd[1]: Stopping Session 2 of user ctor.
...
[  211.953070] systemd[1]: session-2.scope: Stopping timed out. Killing.
[  211.953183] systemd[1]: session-2.scope: Killing process 3584 (qubes-guid) with signal SIGKILL.
[  211.953372] systemd[1]: [email protected]: State 'stop-sigterm' timed out. Killing.
[  211.953742] systemd[1]: [email protected]: Killing process 3382 (systemd) with signal SIGKILL.
[  211.954105] systemd[1]: [email protected]: Killing process 3874 (preshutdown) with signal SIGKILL.
[  211.954153] systemd[1]: [email protected]: Killing process 4923 (sleep) with signal SIGKILL.
[  211.956105] systemd[1]: Stopped User Manager for UID 1000.
[  211.956164] systemd[1]: [email protected]: Unit entered failed state.
[  211.956186] systemd[1]: [email protected]: Failed with result 'timeout'.
[  211.956386] systemd[1]: Stopped Session 2 of user ctor.
[  211.956515] systemd[1]: session-2.scope: Unit entered failed state.
[  211.956877] systemd[1]: dev-disk-by\x2did-lvm\x2dpv\x2duuid\x2dpxC3ch\x2d0MF0\x2dOzJs\x2dJogd\x2d9rOz\x2dJkSt\x2dCf8G7m.device: Job dev-disk-by\x2did-lvm\x2dpv\x2duuid\x2dpxC3ch\x2d0MF0\x2dOzJs\x2dJogd\x2d9rOz\x2dJkSt\x2dCf8G7m.device/stop timed out.
[  211.956951] systemd[1]: Timed out stopping /dev/disk/by-id/lvm-pv-uuid-pxC3ch-0MF0-OzJs-Jogd-9rOz-JkSt-Cf8G7m.
[  211.957107] systemd[1]: dev-disk-by\x2did-lvm\x2dpv\x2duuid\x2dpxC3ch\x2d0MF0\x2dOzJs\x2dJogd\x2d9rOz\x2dJkSt\x2dCf8G7m.device: Job dev-disk-by\x2did-lvm\x2dpv\x2duuid\x2dpxC3ch\x2d0MF0\x2dOzJs\x2dJogd\x2d9rOz\x2dJkSt\x2dCf8G7m.device/stop failed with result 'timeout'.
[  211.957280] systemd[1]: dev-disk-by\x2did-dm\x2dname\x2dluks\x2d9ed952b5\x2d2aa8\x2d4564\x2db700\x2dfb23f5c9e94b.device: Job dev-disk-by\x2did-dm\x2dname\x2dluks\x2d9ed952b5\x2d2aa8\x2d4564\x2db700\x2dfb23f5c9e94b.device/stop timed out.
[  211.957335] systemd[1]: Timed out stopping /dev/disk/by-id/dm-name-luks-9ed952b5-2aa8-4564-b700-fb23f5c9e94b.
[  211.957398] systemd[1]: dev-disk-by\x2did-dm\x2dname\x2dluks\x2d9ed952b5\x2d2aa8\x2d4564\x2db700\x2dfb23f5c9e94b.device: Job dev-disk-by\x2did-dm\x2dname\x2dluks\x2d9ed952b5\x2d2aa8\x2d4564\x2db700\x2dfb23f5c9e94b.device/stop failed with result 'timeout'.
[  211.957611] systemd[1]: dev-block-253:0.device: Job dev-block-253:0.device/stop timed out.
[  211.957647] systemd[1]: Timed out stopping LVM PV pxC3ch-0MF0-OzJs-Jogd-9rOz-JkSt-Cf8G7m on /dev/dm-0.
[  211.957715] systemd[1]: dev-block-253:0.device: Job dev-block-253:0.device/stop failed with result 'timeout'.
[  211.957770] systemd[1]: dev-dm\x2d0.device: Job dev-dm\x2d0.device/stop timed out.
[  211.957798] systemd[1]: Timed out stopping /dev/dm-0.
[  211.957847] systemd[1]: dev-dm\x2d0.device: Job dev-dm\x2d0.device/stop failed with result 'timeout'.
[  211.957901] systemd[1]: dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2d9ed952b52aa84564b700fb23f5c9e94b\x2dluks\x2d9ed952b5\x2d2aa8\x2d4564\x2db700\x2dfb23f5c9e94b.device: Job dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2d9ed952b52aa84564b700fb23f5c9e94b\x2dluks\x2d9ed952b5\x2d2aa8\x2d4564\x2db700\x2dfb23f5c9e94b.device/stop timed out.
[  211.957972] systemd[1]: Timed out stopping /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-9ed952b52aa84564b700fb23f5c9e94b-luks-9ed952b5-2aa8-4564-b700-fb23f5c9e94b.
[  211.958047] systemd[1]: dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2d9ed952b52aa84564b700fb23f5c9e94b\x2dluks\x2d9ed952b5\x2d2aa8\x2d4564\x2db700\x2dfb23f5c9e94b.device: Job dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2d9ed952b52aa84564b700fb23f5c9e94b\x2dluks\x2d9ed952b5\x2d2aa8\x2d4564\x2db700\x2dfb23f5c9e94b.device/stop failed with result 'timeout'.
[  211.958075] systemd[1]: sys-devices-virtual-block-dm\x2d0.device: Job sys-devices-virtual-block-dm\x2d0.device/stop timed out.
[  211.958174] systemd[1]: Timed out stopping /sys/devices/virtual/block/dm-0.
[  211.958222] systemd[1]: sys-devices-virtual-block-dm\x2d0.device: Job sys-devices-virtual-block-dm\x2d0.device/stop failed with result 'timeout'.
[  211.958774] systemd[1]: Removed slice User Slice of ctor.
[  211.958911] systemd[1]: Stopping Login Service...
[  211.960223] systemd[1]: Stopping Permit User Sessions...
[  211.964389] systemd[1]: Stopped Permit User Sessions.
[  211.964558] systemd[1]: Stopped Start Qubes VM sys-net.
[  211.964618] systemd[1]: Stopped Start Qubes VM sys-firewall.
[  211.966532] systemd[1]: Removed slice system-qubes\x2dvm.slice.
[  211.970050] systemd[1]: Stopping Qubes memory information reporter...
[  211.975886] systemd[1]: Stopped Qubes memory information reporter.
[  211.982513] systemd[1]: Stopping Qubes Dom0 startup setup...

上記はこのブログで言及されていないものpreshutdownから来たものです(理由はわかりません)。 --user .serviceStopping

しかし、それがサービスで--userあるかどうかに関係なく、--systemsystemdにサービスを停止し、サービスが試行される前に停止を完了するようにどのように指示しますかStopping Session X of user Y

この問題を解決する方法を知っている場合は、おそらく問題を解決できます(または私が解決するのを手伝ってください)。これそれも1つ持ってその小さな賞金を集めてください。

該当する場合、上記のログを生成する私の--userサービス()は次のようになります。/usr/lib/systemd/user/mowron.service

[Unit]
Description=Mowron
#Wants=
RequiresMountsFor=/home/ /dev/dm-0 /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-9ed952b52aa84564b700fb23f5c9e94b-luks-9ed952b5-2aa8-4564-b700-fb23f5c9e94b /dev/disk/by-id/lvm-pv-uuid-pxC3ch-0MF0-OzJs-Jogd-9rOz-JkSt-Cf8G7m /dev/disk/by-id/dm-name-luks-9ed952b5-2aa8-4564-b700-fb23f5c9e94b /sys/devices/virtual/block/dm-0
After=qubes-db-dom0.service libvirtd.service xenconsoled.service qubesd.service qubes-qmemman.service systemd-udev-settle.service remote-fs.target remote-fs-pre.target systemd-user-sessions.service
Conflicts=shutdown.target reboot.target halt.target
#BindsTo=systemd-udev-settle.service systemd-user-sessions.service
#PartOf=systemd-user-sessions.service
#Wants=systemd-user-sessions.service
#Requires=systemd-user-sessions.service
#Failed to start mowron.service: Unit systemd-user-sessions.service not found.
#i mean, it's only here: /usr/lib/systemd/system/systemd-user-sessions.service



[Service]
Type=oneshow
RemainAfterExit=yes
ExecStart=/bin/true
ExecStop=/home/ctor/bin/preshutdown

[Install]
WantedBy=default.target

Fedora 25システムバージョン(アップグレードできません):

[ctor@dom0 ~]$ systemctl --version
systemd 231
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN

ベストアンサー1

おすすめ記事