Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
labmanager-systemd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto LIVIO BECCARIA
labmanager-systemd
Commits
f196b014
Commit
f196b014
authored
3 years ago
by
Alberto LIVIO BECCARIA
Browse files
Options
Downloads
Patches
Plain Diff
Autologin per LightDM
parent
b3a373c3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin-ubuntu/lightdm-autologin
+49
-0
49 additions, 0 deletions
bin-ubuntu/lightdm-autologin
bin-ubuntu/sddm-autologin
+0
-0
0 additions, 0 deletions
bin-ubuntu/sddm-autologin
systemd-ubuntu/esame-dm-autologin.service
+3
-3
3 additions, 3 deletions
systemd-ubuntu/esame-dm-autologin.service
with
52 additions
and
3 deletions
bin-ubuntu/lightdm-autologin
0 → 100755
+
49
−
0
View file @
f196b014
#!/bin/bash
clear
()
{
sed
-i
'/autologin-user=/s/^#*/#/'
/etc/lightdm/lightdm.conf
sed
-i
'/session-cleanup-script=/s/^#*/#/'
/etc/lightdm/lightdm.conf
}
dm_restart
()
{
systemctl restart display-manager.service
}
stop
()
{
clear
#dm_restart
}
start
()
{
echo
"LightDM AUTOLOGIN FOR
${
ESAME_USER
}
"
# 1) .* get expanded by the shell if in double quotes...
# 2) $ESAME_USER does not get expanded if in single quotes...
# 3) We want the former as is, and the latter expanded.
# So, one solution is the following:
SEDCMD
=
"/#*autologin-user=.*/s/"
'.*'
"/autologin-user=
$ESAME_USER
/"
sed
-i
"
$SEDCMD
"
/etc/lightdm/lightdm.conf
# enable auto-relogin (remove the comment in the file)
sed
-i
'/session-cleanup-script=/s/^#*//'
/etc/lightdm/lightdm.conf
#sleep 5
dm_restart
}
case
"
$1
"
in
'start'
)
start
;;
'stop'
)
stop
;;
'restart'
)
stop
start
;;
*
)
echo
"Usage:
$0
{ start | stop | restart }"
;
exit
1
;
;;
esac
exit
0
This diff is collapsed.
Click to expand it.
bin-ubuntu/dm-autologin
→
bin-ubuntu/
sd
dm-autologin
+
0
−
0
View file @
f196b014
File moved
This diff is collapsed.
Click to expand it.
systemd-ubuntu/esame-dm-autologin.service
+
3
−
3
View file @
f196b014
[Unit]
[Unit]
Description
=
K
DM Autologin
Description
=
DM Autologin
After
=
esame-mk-homedir.service esame-desktop-wallpaper.service esame-firefox-home.service esame-virtualbox.service
After
=
esame-mk-homedir.service esame-desktop-wallpaper.service esame-firefox-home.service esame-virtualbox.service
[Service]
[Service]
Type
=
oneshot
Type
=
oneshot
RemainAfterExit
=
yes
RemainAfterExit
=
yes
EnvironmentFile
=
-/local/esame-machine.conf
EnvironmentFile
=
-/local/esame-machine.conf
ExecStart
=
/usr/libexec/labmanager/dm-autologin start
ExecStart
=
/usr/libexec/labmanager/
light
dm-autologin start
ExecStop
=
/usr/libexec/labmanager/dm-autologin stop
ExecStop
=
/usr/libexec/labmanager/
light
dm-autologin stop
[Install]
[Install]
WantedBy
=
esame.target esamekiosk.target esameshow.target
WantedBy
=
esame.target esamekiosk.target esameshow.target
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment