]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - server/adduser-novaboot
Rename novaboot-power-off.service to novaboot-delayed-power-off.service
[novaboot.git] / server / adduser-novaboot
index 34134d7a544204a45bb53f3195bca7ff0878ae4b..dec3804cc2bf18ea953d624443a5ae6ee59d11f7 100755 (executable)
@@ -49,7 +49,7 @@ fi
 [ -z "$key" -o "$(echo "$key" | wc -l)" -ne 1 ] && die "--key needs to be just one line"
 echo "$key" | grep -q ssh || die "--key does not look like an SSH public key"
 
-adduser --disabled-password --shell $(which novaboot-shell) $adduser_opts "$@"
+adduser --disabled-password --ingroup novaboot --shell $(which novaboot-shell) $adduser_opts "$@"
 
 user="$1"
 home=$(getent passwd "$user"|awk -F: '{print $6;}')
@@ -69,16 +69,6 @@ else
     echo "NOT creating /srv/tftp/$user and symlink to it from $home/tftproot."
 fi
 
-if [ -d /run/systemd/system ]; then
-    echo "Installing systemd services and timers in /etc/systemd/system/user@$uid.service.d"
-    mkdir -p /etc/systemd/system/user@$uid.service.d
-    cat <<EOF > /etc/systemd/system/user@$uid.service.d/novaboot-server.conf
-[Unit]
-Requires=novaboot-server-login@$user.service
-After=novaboot-server-login@$user.service
-EOF
-fi
-
 echo "Creating configuration template in $home/.novaboot-shell"
 cat <<'CONFIG_EOF' > $home/.novaboot-shell
 #!/bin/sh
@@ -102,6 +92,19 @@ cat <<'CONFIG_EOF' > $home/.novaboot-shell
 # --uboot-addr=ramdisk=0x83100000
 # "
 CONFIG_EOF
+chown $user: $home/.novaboot-shell
+
+if [ -d /run/systemd/system ]; then
+    cat <<EOF
+To enable automatic delayed power-off run 'systemctl --user enable novaboot-delayed-power-off'
+as the created user (e.g. via shell subcommand)
+EOF
+    # TODO: Add a way to run in automatically from here (allow shell
+    #subcommand to accept command lines)
+    #systemctl --user enable novaboot-delayed-power-off
+fi
+
+
 
 echo "Done"
 exit 0
@@ -141,7 +144,8 @@ F<~/.ssh/authorized_keys> and marked with administrator flag.
 =item --admin-id NAME
 
 User name associated with the key. This user name is shown to
-connecting users when the target is occupied.
+connecting users when the target is occupied by the administrator.
+When omitted, I<admin> is used as the user name.
 
 =back