From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 25 Oct 2024 16:34:17 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1t4LOJ-000f2y-2O for lore@lore.pengutronix.de; Fri, 25 Oct 2024 16:34:16 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1t4LOK-0007qC-Mo; Fri, 25 Oct 2024 16:34:16 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t4LO4-0007q1-BF for ptxdist@pengutronix.de; Fri, 25 Oct 2024 16:34:00 +0200 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1t4LO4-000Not-0W for ptxdist@pengutronix.de; Fri, 25 Oct 2024 16:34:00 +0200 Received: from mol by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1t4LO4-00D1A7-0G for ptxdist@pengutronix.de; Fri, 25 Oct 2024 16:34:00 +0200 Date: Fri, 25 Oct 2024 16:34:00 +0200 From: Michael Olbrich To: ptxdist@pengutronix.de Message-ID: Mail-Followup-To: ptxdist@pengutronix.de References: <20241008132331.1372881-1-g.schenk@eckelmann.de> <20241025073255.2195902-1-m.olbrich@pengutronix.de> <346-671b7f00-51-13e69d40@37838701> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <346-671b7f00-51-13e69d40@37838701> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-IRC: #ptxdist @freenode Subject: Re: [ptxdist] [APPLIED] hostapd: Add systemd service unit X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Fri, Oct 25, 2024 at 01:20:17PM +0200, Artur Wiebe wrote: > Hi Michael, > > here /etc/hostapd/hostapd.conf would be installed twice! Right, we're already installing a sample hostapd.conf... I'll remove the duplicate install_alternative and the dummy file. Michael > BR, > Artur > > On Friday, 25 October, 2024 09:32 CEST, Michael Olbrich wrote: > > > Thanks, applied as 49049c01b0a932c74c77b64f1b42c85141fec8e4. > > > > Michael > > > > [sent from post-receive hook] > > > > On Fri, 25 Oct 2024 09:32:55 +0200, Gavin Schenk wrote: > > > If selected, start hostapd as a systemd service in multi-user.target > > > using a configuration file at the specified file path. > > > > > > Signed-off-by: Gavin Schenk > > > Message-Id: <20241008132331.1372881-1-g.schenk@eckelmann.de> > > > Signed-off-by: Michael Olbrich > > > > > > diff --git a/projectroot/etc/hostapd/hostapd.conf b/projectroot/etc/hostapd/hostapd.conf > > > new file mode 100644 > > > index 000000000000..9e425a8c3d71 > > > --- /dev/null > > > +++ b/projectroot/etc/hostapd/hostapd.conf > > > @@ -0,0 +1,2 @@ > > > +# This is a placeholder. You have to provide a real configuration here. See > > > +# hostapd.conf in package hostapd as a starting point for you own configuration. > > > diff --git a/projectroot/usr/lib/systemd/system/hostapd.service b/projectroot/usr/lib/systemd/system/hostapd.service > > > new file mode 100644 > > > index 000000000000..bef52896c28e > > > --- /dev/null > > > +++ b/projectroot/usr/lib/systemd/system/hostapd.service > > > @@ -0,0 +1,15 @@ > > > +[Unit] > > > +Description=Access point and authentication server for Wi-Fi and Ethernet > > > +After=network.target > > > +ConditionFileNotEmpty=/etc/hostapd/hostapd.conf > > > + > > > +[Service] > > > +Type=forking > > > +PIDFile=/run/hostapd.pid > > > +Restart=on-failure > > > +RestartSec=2 > > > +Environment=DAEMON_CONF=/etc/hostapd/hostapd.conf > > > +ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid ${DAEMON_CONF} > > > + > > > +[Install] > > > +WantedBy=multi-user.target > > > diff --git a/rules/hostapd.in b/rules/hostapd.in > > > index 6ac6be52cd6f..9c95fe37387e 100644 > > > --- a/rules/hostapd.in > > > +++ b/rules/hostapd.in > > > @@ -1,10 +1,10 @@ > > > ## SECTION=networking > > > > > > -config HOSTAPD > > > +menuconfig HOSTAPD > > > tristate > > > select OPENSSL > > > select LIBNL3 > > > - prompt "hostapd" > > > + prompt "hostapd " > > > help > > > IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator > > > > > > @@ -21,3 +21,14 @@ config HOSTAPD > > > authentication without requiring an external RADIUS > > > authentication server), and RADIUS authentication server for > > > EAP authentication. > > > + > > > +if HOSTAPD > > > + > > > +config HOSTAPD_SYSTEMD_UNIT > > > + bool > > > + prompt "Enable systemd support" > > > + depends on INITMETHOD_SYSTEMD > > > + help > > > + Install systemd units to start this service on startup. > > > + > > > +endif > > > diff --git a/rules/hostapd.make b/rules/hostapd.make > > > index 2d061b5d4412..11b5ca1b0e08 100644 > > > --- a/rules/hostapd.make > > > +++ b/rules/hostapd.make > > > @@ -74,6 +74,15 @@ $(STATEDIR)/hostapd.targetinstall: > > > @$(call install_copy, hostapd, 0, 0, 0755, -, /usr/sbin/hostapd) > > > @$(call install_alternative, hostapd, 0, 0, 0644, /etc/hostapd/hostapd.conf) > > > > > > +ifdef PTXCONF_HOSTAPD_SYSTEMD_UNIT > > > + @$(call install_alternative, hostapd, 0, 0, 0644, \ > > > + /usr/lib/systemd/system/hostapd.service) > > > + @$(call install_link, hostapd, ../hostapd.service, \ > > > + /lib/systemd/system/multi-user.target.wants/hostapd.service) > > > + @$(call install_alternative, hostapd, 0, 0, 0644, \ > > > + /etc/hostapd/hostapd.conf) > /etc/hostapd/hostapd.conf is already installed above! > > > +endif > > > + > > > @$(call install_finish, hostapd) > > > > > > @$(call touch) > > > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |