Add rfkill-block@.service and rfkill-unblock@.service templates. These make rfkill integration to systemd easier. Files come from openSUSE rfkill package. Example: Use `systemctl {start,stop} rfkill-block@bluetooth` to block or unblock (disable or enable) the bluetooth device. Author: Jochen Keil <jkeil@xxxxxxx> Signed-off-by: Stanislav Brabec <sbrabec@xxxxxxx> --- sys-utils/Makemodule.am | 10 +++++++++- sys-utils/rfkill-block@xxxxxxxxxxx | 11 +++++++++++ sys-utils/rfkill-unblock@xxxxxxxxxxx | 11 +++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 sys-utils/rfkill-block@xxxxxxxxxxx create mode 100644 sys-utils/rfkill-unblock@xxxxxxxxxxx diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am index 825a7335b..0baa6e421 100644 --- a/sys-utils/Makemodule.am +++ b/sys-utils/Makemodule.am @@ -72,6 +72,11 @@ dist_man_MANS += sys-utils/rfkill.8 rfkill_SOURCES = sys-utils/rfkill.c rfkill_LDADD = $(LDADD) libcommon.la libsmartcols.la rfkill_CFLAGS = $(AM_CFLAGS) -I$(ul_libsmartcols_incdir) +if HAVE_SYSTEMD +systemdsystemunit_DATA += \ + sys-utils/rfkill-block@.service \ + sys-utils/rfkill-unblock@.service +endif endif if BUILD_SETSID @@ -106,7 +111,10 @@ systemdsystemunit_DATA += \ endif endif # BUILD_FSTRIM -PATHFILES += sys-utils/fstrim.service +PATHFILES += \ + sys-utils/fstrim.service \ + sys-utils/rfkill-block@.service \ + sys-utils/rfkill-unblock@.service EXTRA_DIST += sys-utils/fstrim.timer if BUILD_DMESG diff --git a/sys-utils/rfkill-block@xxxxxxxxxxx b/sys-utils/rfkill-block@xxxxxxxxxxx new file mode 100644 index 000000000..c1ee0b467 --- /dev/null +++ b/sys-utils/rfkill-block@xxxxxxxxxxx @@ -0,0 +1,11 @@ +[Unit] +Description=Disable Device %I by RFKill +After=rfkill-unblock@all.service +Documentation=man:rfkill(8) + +[Service] +Type=oneshot +ExecStart=@usrsbin_execdir@/rfkill block %I + +[Install] +WantedBy=multi-user.target diff --git a/sys-utils/rfkill-unblock@xxxxxxxxxxx b/sys-utils/rfkill-unblock@xxxxxxxxxxx new file mode 100644 index 000000000..bd9c4befe --- /dev/null +++ b/sys-utils/rfkill-unblock@xxxxxxxxxxx @@ -0,0 +1,11 @@ +[Unit] +Description=Enable Device %I by RFKill +After=rfkill-block@all.service +Documentation=man:rfkill(8) + +[Service] +Type=oneshot +ExecStart=@usrsbin_execdir@/rfkill unblock %I + +[Install] +WantedBy=multi-user.target -- 2.19.1 -- Best Regards / S pozdravem, Stanislav Brabec software developer --------------------------------------------------------------------- SUSE LINUX, s. r. o. e-mail: sbrabec@xxxxxxxx Křižíkova 148/34 (Corso IIa) tel: +49 911 7405384547 186 00 Praha 8-Karlín fax: +420 284 084 001 Czech Republic http://www.suse.cz/ PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76