[systemd-devel] Convert Inittab-Entry to systemd
Daniel Spannbauer
ds at marco.de
Tue Aug 27 23:36:31 PDT 2013
Am 08/27/2013 07:50 PM, schrieb Kok, Auke-jan H:
> On Tue, Aug 27, 2013 at 9:38 AM, Colin Guthrie <gmane at colin.guthr.ie> wrote:
>> Also I don't think this will properly handle session registration will
>> it? There is nothing here that registers the session - no pam configs to
>> include pam_systemd etc.
>
> nope
>
>> I think you would need some kind of PAMName= attribute here to also
>> handle that (man systemd.exec(5)). Obviously the /etc/pam.d/ stuff would
>> need to be configured accordingly with appropriate permissions (I
>> presume) to allow autologin but also ensure the pam_systemd stuff is
>> configured properly. Never tried this kind of autologin but I don't
>> think I'm talking too much nonsense :D
>
> PAMName=login should just work here.
>
Hello,
I tried it with "PAMName"...the service did not start at boot or when
started manually. See the logs below...
---------------------------------------------
2013-07-12T01:27:54.651603-04:00 instalz11 systemd[1]: Accepted
connection on private bus.
2013-07-12T01:27:54.652862-04:00 instalz11 systemd[1]: Got D-Bus
request: org.freedesktop.systemd1.Manager.StartUnit() on
/org/freedesktop/systemd1
2013-07-12T01:27:54.653976-04:00 instalz11 systemd[1]: Trying to enqueue
job autologin.service/start/replace
2013-07-12T01:27:54.659879-04:00 instalz11 systemd[1]: Installed new job
autologin.service/start as 328
2013-07-12T01:27:54.661088-04:00 instalz11 systemd[1]: Enqueued job
autologin.service/start as 328
2013-07-12T01:27:54.661894-04:00 instalz11 systemd[1]: Starting marco
Autologin...
2013-07-12T01:27:54.662595-04:00 instalz11 systemd[1]: About to execute
/usr/bin/xinit /home/xalz/.xsession -- /usr/bin/X :1 vt08 -r -br -dpms
-s off
2013-07-12T01:27:54.663403-04:00 instalz11 systemd[1]: Forked
/usr/bin/xinit as 2422
2013-07-12T01:27:54.664222-04:00 instalz11 systemd[1]: autologin.service
changed failed -> running
2013-07-12T01:27:54.664933-04:00 instalz11 systemd[1]: Job
autologin.service/start finished, result=done
2013-07-12T01:27:54.665670-04:00 instalz11 systemd[1]: Started marco
Autologin.
2013-07-12T01:27:54.666388-04:00 instalz11 systemd[1]: Got D-Bus
request: org.freedesktop.systemd1.Manager.GetUnit() on
/org/freedesktop/systemd1
2013-07-12T01:27:54.667097-04:00 instalz11 systemd[1]: Got D-Bus
request: org.freedesktop.DBus.Properties.Get() on
/org/freedesktop/systemd1/unit/autologin_2eservice
2013-07-12T01:27:54.667791-04:00 instalz11 systemd[2422]: Failed at step
PAM spawning /usr/bin/xinit: Operation not permitted
2013-07-12T01:27:54.668226-04:00 instalz11 systemd:
pam_warn(xalz:account): function=[pam_sm_acct_mgmt] service=[xalz]
terminal=[<unknown>] user=[xalz] ruser=[<unknown>] rhost=[<unknown>]
2013-07-12T01:27:54.673326-04:00 instalz11 systemd[1]: Unit
autologin.service entered failed state
2013-07-12T01:27:54.674982-04:00 instalz11 systemd[1]: Accepted
connection on private bus.
2013-07-12T01:27:54.675811-04:00 instalz11 systemd[1]: Got D-Bus
request: org.freedesktop.systemd1.Agent.Released() on
/org/freedesktop/systemd1/agent
2013-07-12T01:27:54.676530-04:00 instalz11 systemd[1]:
autologin.service: cgroup is empty
2013-07-12T01:27:54.677264-04:00 instalz11 systemd[1]: Got D-Bus
request: org.freedesktop.DBus.Local.Disconnected() on
/org/freedesktop/DBus/Local
------------------------------------------------------------------------------
Here is the service-file:
[Unit]
Description=marco Autologin
After=getty.target
[Service]
ExecStart=/usr/bin/xinit /home/xalz/.xsession -- /usr/bin/X :1 vt08 -r
-br -dpms -s off
User=xalz
PAMName=xalz
Group=alz
Environment="PATH=/usr/uti/sys:/usr/uti:/usr/uti/mcu::/usr/uti/sys:/usr/uti:/usr/uti/mcu:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/uti/inst:/usr/uti/inst"
[Install]
WantedBy=multi-user.target
any ideas?
Regards
Daniel
--
Daniel Spannbauer Systemadministration
marco Systemanalyse und Entwicklung GmbH Tel +49 8333 9233-27 Fax -11
Rechbergstr. 4-6, D 87727 Babenhausen Mobil +49 171 4033220
http://www.marco.de/ Email ds at marco.de
Geschäftsführer Martin Reuter HRB 171775 Amtsgericht München
More information about the systemd-devel
mailing list