Le jeudi 02 août 2012 à 08:07 +0200, Stefan Seyfried a écrit :
Am 02.08.2012 06:41, schrieb Will Stephenson:
On Friday 27 Jul 2012 19:32:47 Stefan Seyfried wrote:
(redirecting to factory again)
Am 27.07.2012 17:55, schrieb "Stefan Brüns":
Am 07/27/12, schrieb Stefan Seyfried <stefan.seyfried@googlemail.com>:
The problem is, that starting a service by default is considered bad. And I am still looking for ideas on how to start it only if a bluetooth adapter is present... :-(
should be working out of the box already (see systemd for Developers II [1], Hardware Activation in Detail):
cat /lib/systemd/system/bluetooth.service [Unit] Description=Bluetooth service After=syslog.target
[Service] Type=dbus BusName=org.bluez ExecStart=/usr/sbin/bluetoothd -n StandardOutput=syslog
[Install] WantedBy=bluetooth.target
Yes, but it only works if we "systemctl enable bluetooth.service" And then bluetoothd is started regardless of an adapter being present...
Would something like this work?
/etc/udev/rules.d/95-bluez.rules: SUBSYSTEM=="bluetooth", NAME=="hci?", TAG+="systemd", ACTION=="add", \ ENV{SYSTEMD_WANTS}="bluetooth.service"
That's already in upstream systemd: seife@susi:~> grep SYSTEMD_WANTS.*bluetooth /lib/udev/rules.d/* /lib/udev/rules.d/99-systemd.rules:SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}="bluetooth.target"
But it only works if I "systemctl enable bluetooth.service". And then bluetoothd is always started, no matter if an adapter is present or not...
No, "systemctl enable bluetooth.service" just ensures bluetooth.service is enabled in bluetooth.target. So, the real question is when bluetooth.target is enabled and from what I see, it has "StopWhenUnneeded=yes" and nothing is enabling it by default (except udev). -- Frederic Crozat <fcrozat@suse.com> SUSE -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org