On 10/16/2011 11:18 AM, Ludovic Rousseau wrote: > Hello Kalev, > > Some more questions :-) > > 2011/6/25 Kalev Lember <[email protected]>: >> diff --git a/PCSC/etc/pcscd.service.in b/PCSC/etc/pcscd.service.in >> new file mode 100644 >> index 0000000..4800d32 >> --- /dev/null >> +++ b/PCSC/etc/pcscd.service.in >> @@ -0,0 +1,13 @@ >> +[Unit] >> +Description=PC/SC Smart Card Daemon >> +Requires=pcscd.socket >> +After=syslog.target
(According to Lennart, After=syslog.target is no longer necessary with the version of systemd in Fedora 16, so we could probably drop this line.) >> + >> +[Service] >> +ExecStart=@sbindir_exp@/pcscd -f >> +ExecReload=@sbindir_exp@/pcscd -H >> +StandardOutput=syslog (... and the same as above about StandardOutput=syslog: stdout and stderr should now be connected to syslog by default.) >> + >> +[Install] >> +WantedBy=multi-user.target >> +Also=pcscd.socket > > Why do you have "WantedBy=multi-user.target"? > The idea is to have pcscd started on demand using the socket > activation mechanism. I do not want to have pcscd started at boot, but > only on demand. > So I propose to remove the line. The [Install] section is used when someone runs 'systemctl enable' / 'systemctl disable' on the pcscd.service file. When a user runs the command, the WantedBy=multi-user.target line adds the pcscd.service dependency to the multi-user.target, effectively marking pcscd to always start up on system boot. I can imagine that some people would want to do that, but I'm personally fine with killing that use case. A related question -- why do you ship pcscd sysv init script in the Debian package, instead of just relying on the on-demand startup? I think in the long run we'll instead want to have 'WantedBy=smartcard.target' and configure it for hardware activation. But I haven't yet looked into how it works so I don't know the details. > I am no sure the line "Also=pcscd.socket" is needed. I removed it > without any problem. Like the rest of the [Install] section in pcscd.service, this is only used when someone runs 'systemctl enable/disable pcscd.service'. The Also=pcscd.socket line also enables pcscd.socket when pcscd.service is enabled. That way, people can run 'systemctl enable pcscd.service' instead of 'systemctl enable pcscd.socket' and things would automagically still work correctly. I'd certainly vote for keeping this one. > I played with systemd and what I was missing is that I need to enable > and start the pcscd.socket using: > $ sudo systemctl enable pcscd.socket > $ sudo systemctl start pcscd.socket > > > I also added the --auto-exit option to pcscd so that the daemon will > exit when no more needed. > The daemon is started when needed using the systemd socket activation > method and will exit automatically when not needed. Not sure ... If you say you've tested it and systemd plays nice when the daemon exits with exit code 0, I guess this could work. Might want to bring this up on the systemd mailing list. -- Hope this helps, Kalev _______________________________________________ Muscle mailing list [email protected] http://lists.drizzle.com/mailman/listinfo/muscle
