diff mbox series

[meta-arago,kirkstone] matrix-gui: move script from /etc/init.d to data dir.

Message ID 20231022130905.3962948-1-s-adivi@ti.com
State Superseded
Delegated to: Ryan Eatmon
Headers show
Series [meta-arago,kirkstone] matrix-gui: move script from /etc/init.d to data dir. | expand

Commit Message

Sai Sree Kartheek Adivi Oct. 22, 2023, 1:09 p.m. UTC
since sysvinit is deprecated, avoid installing scripts in sysvinit.
Use data dir to install scripts which need to be called by the systemd services.

Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
---
 .../recipes-core/matrix/matrix-gui/matrix-gui-2.0.service      | 2 +-
 meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb         | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

Comments

Denys Dmytriyenko Oct. 23, 2023, 6:09 p.m. UTC | #1
On Sun, Oct 22, 2023 at 06:39:05PM +0530, Sai Sree Kartheek Adivi wrote:
> since sysvinit is deprecated, avoid installing scripts in sysvinit.
> Use data dir to install scripts which need to be called by the systemd services.

Well, sysvinit is not deprecated - it's still an option. With this change 
nobody would be able to use Matrix with sysvinit-enabled distro anymore?

A better approach would be to have a dedicated and independent systemd unit 
file that doesn't call the sysvinit counterpart. And then make the install 
steps below conditional on INIT_MANAGER variable or corresponding flag in the 
DISTRO_FEATURES lsit...


> Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
> ---
>  .../recipes-core/matrix/matrix-gui/matrix-gui-2.0.service      | 2 +-
>  meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb         | 3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service b/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
> index 40a8f0f9..84e9195b 100644
> --- a/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
> +++ b/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
> @@ -12,7 +12,7 @@ IgnoreSIGPIPE=no
>  KillMode=process
>  GuessMainPID=no
>  RemainAfterExit=yes
> -ExecStart=/etc/init.d/matrix-gui-2.0 start
> +ExecStart=/usr/share/matrix-gui-2.0/matrix-gui-2.0 start
>  
>  [Install]
>  WantedBy=multi-user.target
> diff --git a/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb b/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
> index 9299a929..18ccc0c9 100644
> --- a/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
> +++ b/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
> @@ -50,8 +50,7 @@ do_install(){
>  	sed -i -e "s/__SWITCH_FOREGROUND_VT__/${SWITCH_FOREGROUND_VT}/" ${WORKDIR}/${MATRIX_INITSCRIPT}
>  
>  	# Install the script
> -	install -d ${D}${sysconfdir}/init.d
> -	install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${sysconfdir}/init.d/matrix-gui-2.0
> +	install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${MATRIX_BASE_DIR}/matrix-gui-2.0
>  
>  	# Install the systemd unit file
>  	install -d ${D}${systemd_system_unitdir}
> -- 
> 2.34.1
>
Jon Cormier Oct. 23, 2023, 7:36 p.m. UTC | #2
On Mon, Oct 23, 2023 at 2:10 PM Denys Dmytriyenko <denis@denix.org> wrote:

> On Sun, Oct 22, 2023 at 06:39:05PM +0530, Sai Sree Kartheek Adivi wrote:
> > since sysvinit is deprecated, avoid installing scripts in sysvinit.
> > Use data dir to install scripts which need to be called by the systemd
> services.
>
> Well, sysvinit is not deprecated - it's still an option. With this change
> nobody would be able to use Matrix with sysvinit-enabled distro anymore?
>
> A better approach would be to have a dedicated and independent systemd
> unit
> file that doesn't call the sysvinit counterpart. And then make the install
> steps below conditional on INIT_MANAGER variable or corresponding flag in
> the
> DISTRO_FEATURES lsit...
>
Agreed.

Also while you're working on the systemd service file.  It needs to depend
on lighttpd.service, otherwise it's possible for the matrix browser to
launch before the webserver is ready, and you get a 404.
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1246859/am3358-sdk-08_02_00_24-matrix-gui-2-0-service-loads-with-a-404-error

>
>
> > Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
> > ---
> >  .../recipes-core/matrix/matrix-gui/matrix-gui-2.0.service      | 2 +-
> >  meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb         | 3 +--
> >  2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git
> a/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
> b/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
> > index 40a8f0f9..84e9195b 100644
> > ---
> a/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
> > +++
> b/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
> > @@ -12,7 +12,7 @@ IgnoreSIGPIPE=no
> >  KillMode=process
> >  GuessMainPID=no
> >  RemainAfterExit=yes
> > -ExecStart=/etc/init.d/matrix-gui-2.0 start
> > +ExecStart=/usr/share/matrix-gui-2.0/matrix-gui-2.0 start
> >
> >  [Install]
> >  WantedBy=multi-user.target
> > diff --git a/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
> b/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
> > index 9299a929..18ccc0c9 100644
> > --- a/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
> > +++ b/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
> > @@ -50,8 +50,7 @@ do_install(){
> >       sed -i -e "s/__SWITCH_FOREGROUND_VT__/${SWITCH_FOREGROUND_VT}/"
> ${WORKDIR}/${MATRIX_INITSCRIPT}
> >
> >       # Install the script
> > -     install -d ${D}${sysconfdir}/init.d
> > -     install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT}
> ${D}${sysconfdir}/init.d/matrix-gui-2.0
> > +     install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT}
> ${D}${MATRIX_BASE_DIR}/matrix-gui-2.0
> >
> >       # Install the systemd unit file
> >       install -d ${D}${systemd_system_unitdir}
> > --
> > 2.34.1
> >
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#14967):
> https://lists.yoctoproject.org/g/meta-arago/message/14967
> Mute This Topic: https://lists.yoctoproject.org/mt/102115715/7902621
> Group Owner: meta-arago+owner@lists.yoctoproject.org
> Unsubscribe:
> https://lists.yoctoproject.org/g/meta-arago/leave/12684784/7902621/525442147/xyzzy
> [jcormier@criticallink.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
>
diff mbox series

Patch

diff --git a/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service b/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
index 40a8f0f9..84e9195b 100644
--- a/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
+++ b/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
@@ -12,7 +12,7 @@  IgnoreSIGPIPE=no
 KillMode=process
 GuessMainPID=no
 RemainAfterExit=yes
-ExecStart=/etc/init.d/matrix-gui-2.0 start
+ExecStart=/usr/share/matrix-gui-2.0/matrix-gui-2.0 start
 
 [Install]
 WantedBy=multi-user.target
diff --git a/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb b/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
index 9299a929..18ccc0c9 100644
--- a/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
+++ b/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
@@ -50,8 +50,7 @@  do_install(){
 	sed -i -e "s/__SWITCH_FOREGROUND_VT__/${SWITCH_FOREGROUND_VT}/" ${WORKDIR}/${MATRIX_INITSCRIPT}
 
 	# Install the script
-	install -d ${D}${sysconfdir}/init.d
-	install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${sysconfdir}/init.d/matrix-gui-2.0
+	install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${MATRIX_BASE_DIR}/matrix-gui-2.0
 
 	# Install the systemd unit file
 	install -d ${D}${systemd_system_unitdir}