From d76c5eeff32a3ea43a965159e25ffb674020bc7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Sat, 26 Nov 2022 10:41:29 +0100 Subject: [PATCH] move files to right place --- .../systemd/scripts/guest-session-homedir.sh | 0 .../systemd/scripts/guest-session.sh | 0 etc/systemd/system/guest-home@.service | 21 +++++++++++++++++++ etc/systemd/system/guest-session@.service | 16 ++++++++++++++ lib/systemd/system/guest-home@.service | 21 ------------------- lib/systemd/system/guest-session@.service | 10 --------- 6 files changed, 37 insertions(+), 31 deletions(-) rename {usr/lib => etc}/systemd/scripts/guest-session-homedir.sh (100%) rename {usr/lib => etc}/systemd/scripts/guest-session.sh (100%) create mode 100644 etc/systemd/system/guest-home@.service create mode 100644 etc/systemd/system/guest-session@.service delete mode 100644 lib/systemd/system/guest-home@.service delete mode 100644 lib/systemd/system/guest-session@.service diff --git a/usr/lib/systemd/scripts/guest-session-homedir.sh b/etc/systemd/scripts/guest-session-homedir.sh similarity index 100% rename from usr/lib/systemd/scripts/guest-session-homedir.sh rename to etc/systemd/scripts/guest-session-homedir.sh diff --git a/usr/lib/systemd/scripts/guest-session.sh b/etc/systemd/scripts/guest-session.sh similarity index 100% rename from usr/lib/systemd/scripts/guest-session.sh rename to etc/systemd/scripts/guest-session.sh diff --git a/etc/systemd/system/guest-home@.service b/etc/systemd/system/guest-home@.service new file mode 100644 index 0000000..20c301c --- /dev/null +++ b/etc/systemd/system/guest-home@.service @@ -0,0 +1,21 @@ +[Unit] +Description=Create and delete $HOME for Guest-Session USER: %i +Before=user@%i.service +#BindsTo=user@%i.service guest-session@%i.service +Conflicts=shutdown.target +BindsTo=user@%i.service +#RefuseManualStart=true + +[Service] +Type=oneshot +RemainAfterExit=true +# if installed to /usr/lib/systemd, then activate this +#ExecStart=-/usr/lib/systemd/scripts/guest-session-homedir.sh create %i +#ExecStop=-/usr/lib/systemd/scripts/guest-session-homedir.sh delete %i + +# if installed to /etc/systemd/syste/, then activate this +ExecStart=-/etc/systemd/scripts/guest-session-homedir.sh create %i +ExecStop= -/etc/systemd/scripts/guest-session-homedir.sh delete %i + +[Install] +WantedBy=user@%i.service diff --git a/etc/systemd/system/guest-session@.service b/etc/systemd/system/guest-session@.service new file mode 100644 index 0000000..343c216 --- /dev/null +++ b/etc/systemd/system/guest-session@.service @@ -0,0 +1,16 @@ +[Unit] +Description=Create guest-user (%i) and activate volatile $HOME for it + +[Service] +RemainAfterExit=true + +# if installed to /usr/lib/systemd, then activate this +#ExecStart=/usr/lib/systemd/scripts/guest-session.sh create "%I" +#ExecStop=/usr/lib/systemd/scripts/guest-session.sh delete "%I" + +# if installed to /etc/systemd/syste/, then activate this +ExecStart=/etc/systemd/scripts/guest-session.sh create "%I" +ExecStop= /etc/systemd/scripts/guest-session.sh delete "%I" + +[Install] +WantedBy=multi-user.target diff --git a/lib/systemd/system/guest-home@.service b/lib/systemd/system/guest-home@.service deleted file mode 100644 index ba2924f..0000000 --- a/lib/systemd/system/guest-home@.service +++ /dev/null @@ -1,21 +0,0 @@ -[Unit] -Description=Create and delete $HOME for Guest-Session USER: %i -Before=user@%i.service -#BindsTo=user@%i.service guest-session@%i.service -Conflicts=shutdown.target -BindsTo=user@%i.service -#RefuseManualStart=true - -[Service] -Type=oneshot -RemainAfterExit=true -#ExecStartPre=/bin/sh -c '/bin/systemctl set-environment SKEL=/etc/skel$(/usr/bin/id -un %i)' -#ExecStartPre=/bin/sh -c '/bin/systemctl set-environment SK=$(test -e $SKEL && echo -n $SKEL || echo -n "/etc/skel")' -#ExecStartPre=/bin/sh -c '/bin/systemctl set-environment UHOME=$(getent passwd %i | cut -d: -f6)' -#ExecStartPre=/etc/systemd/system/scripts/guest-session-homedir.sh create "$SKEL" "$UHOME" -ExecStart=/usr/lib/systemd/scripts/guest-session-homedir.sh create %i -#ExecStart=/bin/chown -R %i:%i "$UHOME" -ExecStop=-/usr/lib/systemd/scripts/guest-session-homedir.sh delete %i - -[Install] -WantedBy=user@%i.service diff --git a/lib/systemd/system/guest-session@.service b/lib/systemd/system/guest-session@.service deleted file mode 100644 index e59b308..0000000 --- a/lib/systemd/system/guest-session@.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Create guest-user (%i) and activate volatile $HOME for it - -[Service] -RemainAfterExit=true -ExecStart=/usr/lib/systemd/scripts/guest-session.sh create "%I" -ExecStop=/usr/lib/systemd/scripts/guest-session.sh delete "%I" - -[Install] -WantedBy=multi-user.target