Studied systemctl/systemd inside work #2
This commit is contained in:
parent
07eb195941
commit
6a2b42dd97
25
clone/clone
25
clone/clone
|
@ -236,29 +236,14 @@ step8(){
|
|||
echo "\n>>> [8] Set up automatic login";
|
||||
|
||||
|
||||
# (1) Copy default login systemd script #
|
||||
#echo " (.) Copy default getty systemd script";
|
||||
#sudo cp /mnt/lib/systemd/system/getty@.service /mnt/etc/systemd/system/autologin@.service;
|
||||
#sudo chmod 755 /mnt/etc/systemd/system/autologin@.service;
|
||||
# (1) Create link in order to be handled #
|
||||
echo " (.) Emulate \`systemctl set-default multi-user.target\`";
|
||||
sudo ln -fs /mnt/lib/systemd/system/multi-user.target /mnt/etc/systemd/system/default.target;
|
||||
|
||||
# (2) Create link in order to be handled #
|
||||
echo " (.) Link systemd files to be handled";
|
||||
# (2) Link autologin to tty service #
|
||||
echo " (.) Link autologin script to tty's default";
|
||||
sudo ln -fs /mnt/etc/systemd/system/autologin@.service /mnt/etc/systemd/system/getty.target.wants/getty@tty1.service;
|
||||
|
||||
sudo ln -fs /mnt/lib/systemd/system/multi-user.target /mnt/etc/systemd/system/default.target;
|
||||
# (3) Update autologin script #
|
||||
#echo " (.) Update script to autologin as 'sats-user'";
|
||||
#sudo cat /mnt/etc/systemd/system/autologin@.service | \
|
||||
# sed 's/^ExecStart=-\/sbin\/agetty --noclear/ExecStart=-\/sbin\/agetty --autologin sats-user/' | \
|
||||
# sed 's/^Restart=.\+$/Restart=no/' | \
|
||||
# sed 's/^Restart=.\+$/Restart=no/' | \
|
||||
# sed 's/^\[Service\]$/\[Service\]\nAlias=getty.target.wants\/getty@tty1.service/' | \
|
||||
# tee tmp/autologin > /dev/null;
|
||||
|
||||
# (4) Updating file from tmp update #
|
||||
#echo " (.) Copying temporary update to real file";
|
||||
#cat tmp/autologin | sudo tee /mnt/etc/systemd/system/autologin@.service > /dev/null;
|
||||
#rm tmp/autologin;
|
||||
|
||||
echo "<<< done";
|
||||
|
||||
|
|
Loading…
Reference in New Issue