diff mbox series

[meta-arago,kirkstone,v2] matrix-gui: handle systemd and sysvinit scripts separately

Message ID 20231025133351.3043121-1-s-adivi@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-arago,kirkstone,v2] matrix-gui: handle systemd and sysvinit scripts separately | expand

Commit Message

Sai Sree Kartheek Adivi Oct. 25, 2023, 1:33 p.m. UTC
- Install systemd service file or init script based on the distro_features
systemd/sysvinit.
- systemd service also needs to depend on lighttpd service so that matrix
won't start before the webserver.

Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
---
v2: Handle both sysvinit and systemd

 .../matrix/matrix-gui/matrix-gui-2.0.service      |  4 ++--
 .../recipes-core/matrix/matrix-gui_2.0.bb         | 15 +++++++++------
 2 files changed, 11 insertions(+), 8 deletions(-)

Comments

Sinthu Raja M Nov. 8, 2023, 1:15 p.m. UTC | #1
On Wed, Oct 25, 2023 at 7:04 PM Sai Sree Kartheek Adivi via
lists.yoctoproject.org <s-adivi=ti.com@lists.yoctoproject.org> wrote:
>
> - Install systemd service file or init script based on the distro_features
> systemd/sysvinit.
> - systemd service also needs to depend on lighttpd service so that matrix
> won't start before the webserver.
>
> Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
Acked-by: Sinthu Raja <sinthu.raja@ti.com>
> ---
> v2: Handle both sysvinit and systemd
>
>  .../matrix/matrix-gui/matrix-gui-2.0.service      |  4 ++--
>  .../recipes-core/matrix/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmatrix-gui_2.0.bb&c=E,1,uI-aTWTLE9ebq4R3RRhS3S8RX4mThQe73KXtJzBcCtLbuT9CAfon0qUNsZaGAYmVEb7cr_NfkruorcLHBDi8AYtBCW2hrE-kRJZa5y3Skpd0&typo=1         | 15 +++++++++------
>  2 files changed, 11 insertions(+), 8 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..462803f3 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
> @@ -1,6 +1,6 @@
>  [Unit]
>  Description=Matrix GUI
> -After=weston.service
> +After=weston.service lighttpd.service
>  Requires=weston.service
>  Before=https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgraphical.target&c=E,1,MPCJR5Y4V0RWJzSDnznRKN2ocAPgZGqc-8AanIuzWjQwtMXg4RzQOiBv1lfLcnGLmh4X1Webx5-n4SomRVgodrVDQJGczrNUthox4E9U-bkPoRTZtfoxsFUx&typo=1
>
> @@ -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=https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmulti-user.target&c=E,1,FO2Ep-vm1QYUBkm_bcHCCXGwd7W8aDmv6B7saNjwSFd5K0QxebHludZWi273myKGPpfwX3GS-LvRbG7dqhbDZ4g_pyObIv0QgecW3MXn8A,,&typo=1
> diff --git a/meta-arago-demos/recipes-core/matrix/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmatrix-gui_2.0.bb&c=E,1,S1mPhUDq1Ebyj8vRVLjlNdDwKY8xkbXYVvHUkQQHm4y6npO3yg9CGl1d6ufzS-zT8CeAHTxsPXamdttlpNhlp3HDeWnSkV5C0HLnm4KKui4T&typo=1 b/meta-arago-demos/recipes-core/matrix/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmatrix-gui_2.0.bb&c=E,1,0wzPiHCI02ttqigGTj-XVwcZ5pEiRSzuobJBNdwcbBa9GW2TmMRSzS3l0phNqekNzoq7jkyxwW7uq03K6PIR9m8OX2cS_jNWj6KPotaLQVRRsY4,&typo=1
> index 9299a929..508edb9b 100644
> --- a/meta-arago-demos/recipes-core/matrix/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmatrix-gui_2.0.bb&c=E,1,EIwOZOJCxC7TXdt5ShejRgxesEuhZKooaS1Z-sBCwG8Hx03bBp4wobKMm98zjFzSBnII_qUdDvO-vc56huvTO90kNlUqmeWMSoA37fdUL-xMEGio&typo=1
> +++ b/meta-arago-demos/recipes-core/matrix/https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmatrix-gui_2.0.bb&c=E,1,5NNhxGZ76cFnRRNxkiWeN706JKr2IUXiUV-Zxl5bRk-T_i8lexVL7kpKEgdqbSTaFpqcukoC6_vxrlB2rm6N3NYBiyc7Obuh_0LH26hfC6xaTP_4unwtavgD2A,,&typo=1
> @@ -50,12 +50,15 @@ 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 the systemd unit file
> -       install -d ${D}${systemd_system_unitdir}
> -       install -m 0644 ${WORKDIR}/matrix-gui-2.0.service ${D}${systemd_system_unitdir}
> +       if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
> +               install -d ${D}${sysconfdir}/init.d
> +               install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${sysconfdir}/init.d/matrix-gui-2.0
> +       fi
> +       if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
> +               install -d ${D}${systemd_system_unitdir}
> +               install -m 0644 ${WORKDIR}/matrix-gui-2.0.service ${D}${systemd_system_unitdir}
> +               install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${MATRIX_BASE_DIR}/matrix-gui-2.0
> +       fi
>  }
>
>  GUIDEPS = "${@bb.utils.contains('DISTRO_FEATURES','opengl',"matrix-gui-browser refresh-screen",'',d)}"
> --
> 2.34.1
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#14970): https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.yoctoproject.org%2fg%2fmeta-arago%2fmessage%2f14970&c=E,1,82vhypDK5rcX-umeF_e4UOjCPwNB75UdQqbYYv1-nSkhKEbXGh6CMn4HucAoh7REp_1Rpon43EOIXc0TH3irBGQS6zkUsOaFfrkLyKBpuc3Sd8Ipu8nLzwk,&typo=1
> Mute This Topic: https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.yoctoproject.org%2fmt%2f102177988%2f6034914&c=E,1,ukl3wgz_kSGrKm0lK0KmDdu4t9PZ2iiZKZUhC64iQ88bKV_7ZIda6k3_j0l44OsGLbbT_l30kSLZU7Xol_37eMNJG0oZk0V0zbBUJJp_AkGNGg,,&typo=1
> Group Owner: meta-arago+owner@lists.yoctoproject.org
> Unsubscribe: https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.yoctoproject.org%2fg%2fmeta-arago%2funsub&c=E,1,R8Ie2IZt2c3x2MzraIFlKi_MdqxCs3S3VeXY06Wy6DrE6c-qS7aWvdj0aeKCz_NZiQgooQhjePvwLVm7hoyuA98r266f0LXHnuh8CNfrB6s,&typo=1 [sinthu.raja@mistralsolutions.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..462803f3 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
@@ -1,6 +1,6 @@ 
 [Unit]
 Description=Matrix GUI
-After=weston.service
+After=weston.service lighttpd.service
 Requires=weston.service
 Before=graphical.target
 
@@ -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..508edb9b 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,12 +50,15 @@  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 the systemd unit file
-	install -d ${D}${systemd_system_unitdir}
-	install -m 0644 ${WORKDIR}/matrix-gui-2.0.service ${D}${systemd_system_unitdir}
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+		install -d ${D}${sysconfdir}/init.d
+		install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${sysconfdir}/init.d/matrix-gui-2.0
+	fi
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		install -d ${D}${systemd_system_unitdir}
+		install -m 0644 ${WORKDIR}/matrix-gui-2.0.service ${D}${systemd_system_unitdir}
+		install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${MATRIX_BASE_DIR}/matrix-gui-2.0
+	fi
 }
 
 GUIDEPS = "${@bb.utils.contains('DISTRO_FEATURES','opengl',"matrix-gui-browser refresh-screen",'',d)}"