From owner-svn-src-head@freebsd.org Mon Jun 11 22:48:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2296E1008BF5; Mon, 11 Jun 2018 22:48:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C878782DDD; Mon, 11 Jun 2018 22:48:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1B6421BDD; Mon, 11 Jun 2018 22:48:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5BMmZBG044275; Mon, 11 Jun 2018 22:48:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5BMmZV6044273; Mon, 11 Jun 2018 22:48:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806112248.w5BMmZV6044273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 11 Jun 2018 22:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334982 - in head/etc: . devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/etc: . devd X-SVN-Commit-Revision: 334982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 22:48:36 -0000 Author: imp Date: Mon Jun 11 22:48:34 2018 New Revision: 334982 URL: https://svnweb.freebsd.org/changeset/base/334982 Log: User service foo rather than /etc/rc.d/foo. devd predates service in the system. Modernize usage to use service to start/stop things in reaction to events rather than calling the rc file directly. This was pointed out in my talk at BSDcan as well as indirectly referrred to as a barrier to entry for OpenRC in that working group. Modified: head/etc/devd.conf head/etc/devd/apple.conf head/etc/devd/devmatch.conf Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Mon Jun 11 20:46:20 2018 (r334981) +++ head/etc/devd.conf Mon Jun 11 22:48:34 2018 (r334982) @@ -57,7 +57,7 @@ notify 0 { match "system" "IFNET"; match "type" "LINK_UP"; media-type "ethernet"; - action "/etc/rc.d/dhclient quietstart $subsystem"; + action "service dhclient quietstart $subsystem"; }; # @@ -76,7 +76,7 @@ notify 0 { match "system" "IFNET"; match "type" "LINK_UP"; media-type "802.11"; - action "/etc/rc.d/dhclient quietstart $subsystem"; + action "service dhclient quietstart $subsystem"; }; # An entry like this might be in a different file, but is included here @@ -94,11 +94,11 @@ detach 100 { # When a USB Bluetooth dongle appears, activate it attach 100 { device-name "ubt[0-9]+"; - action "/etc/rc.d/bluetooth quietstart $device-name"; + action "service bluetooth quietstart $device-name"; }; detach 100 { device-name "ubt[0-9]+"; - action "/etc/rc.d/bluetooth quietstop $device-name"; + action "service bluetooth quietstop $device-name"; }; # Firmware downloader for Atheros AR3011 based USB Bluetooth devices @@ -111,11 +111,11 @@ detach 100 { # When a USB keyboard arrives, attach it as the console keyboard. attach 100 { device-name "ukbd0"; - action "/etc/rc.d/syscons setkeyboard /dev/ukbd0"; + action "service syscons setkeyboard /dev/ukbd0"; }; detach 100 { device-name "ukbd0"; - action "/etc/rc.d/syscons setkeyboard /dev/kbd0"; + action "service syscons setkeyboard /dev/kbd0"; }; notify 100 { @@ -124,7 +124,7 @@ notify 100 { match "type" "CREATE"; match "cdev" "atp[0-9]+"; - action "/etc/rc.d/moused quietstart $cdev"; + action "service moused quietstart $cdev"; }; notify 100 { @@ -133,7 +133,7 @@ notify 100 { match "type" "CREATE"; match "cdev" "ums[0-9]+"; - action "/etc/rc.d/moused quietstart $cdev"; + action "service moused quietstart $cdev"; }; notify 100 { @@ -142,7 +142,7 @@ notify 100 { match "type" "CREATE"; match "cdev" "wsp[0-9]+"; - action "/etc/rc.d/moused quietstart $cdev"; + action "service moused quietstart $cdev"; }; notify 100 { @@ -151,7 +151,7 @@ notify 100 { match "type" "DESTROY"; match "cdev" "ums[0-9]+"; - action "/etc/rc.d/moused stop $cdev"; + action "service moused stop $cdev"; }; # Firmware download into the ActiveWire board. After the firmware download is @@ -236,7 +236,7 @@ nomatch 10 { notify 10 { match "system" "ACPI"; match "subsystem" "ACAD"; - action "/etc/rc.d/power_profile $notify"; + action "service power_profile $notify"; }; # Notify all users before beginning emergency shutdown when we get @@ -317,7 +317,7 @@ notify 10 { notify 0 { match "system" "RCTL"; match "rule" "user:770:swap:.*"; - action "/usr/local/etc/rc.d/postgresql restart"; + action "service postgresql restart"; }; # Discard autofs caches, useful for the -media special map. Modified: head/etc/devd/apple.conf ============================================================================== --- head/etc/devd/apple.conf Mon Jun 11 20:46:20 2018 (r334981) +++ head/etc/devd/apple.conf Mon Jun 11 22:48:34 2018 (r334982) @@ -76,5 +76,5 @@ notify 10 { match "system" "PMU"; match "subsystem" "POWER"; match "type" "ACLINE"; - action "/etc/rc.d/power_profile $notify"; + action "service power_profile $notify"; }; Modified: head/etc/devd/devmatch.conf ============================================================================== --- head/etc/devd/devmatch.conf Mon Jun 11 20:46:20 2018 (r334981) +++ head/etc/devd/devmatch.conf Mon Jun 11 22:48:34 2018 (r334982) @@ -9,7 +9,7 @@ # # Generic NOMATCH event nomatch 100 { - action "/etc/rc.d/devmatch start '?$_'"; + action "service devmatch start '?$_'"; }; # Add the following to devd.conf to prevent this from running: