From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ioQP7-0002gm-Ub for ptxdist@pengutronix.de; Mon, 06 Jan 2020 12:18:37 +0100 Received: from mol by dude02.lab.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1ioQP7-00058x-Mz for ptxdist@pengutronix.de; Mon, 06 Jan 2020 12:18:37 +0100 Date: Mon, 6 Jan 2020 12:18:37 +0100 From: Michael Olbrich Message-ID: <20200106111837.GH5858@pengutronix.de> References: <20191212125457.26860-1-guille.rodriguez@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191212125457.26860-1-guille.rodriguez@gmail.com> Subject: Re: [ptxdist] [PATCH] weston: Add init script List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de On Thu, Dec 12, 2019 at 01:54:57PM +0100, Guillermo Rodr=EDguez wrote: > Signed-off-by: Guillermo Rodriguez > --- Please take a look at how other packages handle this. You'll need a WESTON_STARTSCRIPT option in weston.in and weston-bbinit.in for the link. Michael > projectroot/etc/init.d/weston-init | 29 +++++++++++++++++++++++++++++ > rules/weston.make | 4 ++++ > 2 files changed, 33 insertions(+) > create mode 100644 projectroot/etc/init.d/weston-init > = > diff --git a/projectroot/etc/init.d/weston-init b/projectroot/etc/init.d/= weston-init > new file mode 100644 > index 000000000..fa6b96b07 > --- /dev/null > +++ b/projectroot/etc/init.d/weston-init > @@ -0,0 +1,29 @@ > +#!/bin/sh > + > +start() { > + OPENVT_ARGS=3D"-c 1 -s" > + WESTON_ARGS=3D"--log=3D/var/log/weston.log" > + > + test -f /etc/default/weston-init && . /etc/default/weston-init > + > + if [ -z "$XDG_RUNTIME_DIR" ]; then > + export XDG_RUNTIME_DIR=3D/run/xdg > + mkdir -p "$XDG_RUNTIME_DIR" > + chmod 0700 "$XDG_RUNTIME_DIR" > + fi > + > + echo "Starting Weston" > + exec openvt $OPENVT_ARGS -- weston $WESTON_ARGS > +} > + > +stop() { > + echo "Stopping Weston" > + killall -q weston > +} > + > +case $1 in > + start|stop) $1 ;; > + restart) stop ; sleep 1 ; start ;; > + > + *) echo "Usage: $0 {start|stop|restart}"; exit 1 ;; > +esac > diff --git a/rules/weston.make b/rules/weston.make > index 4c38fd2d1..406b0fd48 100644 > --- a/rules/weston.make > +++ b/rules/weston.make > @@ -170,6 +170,10 @@ endif > ifdef PTXCONF_WESTON_SYSTEMD > @$(call install_lib, weston, 0, 0, 0644, weston/systemd-notify) > endif > +ifdef PTXCONF_INITMETHOD_BBINIT > + @$(call install_alternative, weston, 0, 0, 0755, /etc/init.d/weston-ini= t) > + @$(call install_link, weston, ../init.d/weston-init, /etc/rc.d/S92westo= n-init) > +endif > = > @$(call install_copy, weston, 0, 0, 0755, -, /usr/libexec/weston-simple= -im) > @$(call install_copy, weston, 0, 0, 0755, -, /usr/libexec/weston-deskto= p-shell) > -- = > 2.21.0 > = > = > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > = -- = 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 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de