diff mbox series

[meta-swupdate] swupdate-progress: remove misleading 'exec' statement

Message ID 20240910073402.23281-1-ceggers@arri.de
State Changes Requested
Headers show
Series [meta-swupdate] swupdate-progress: remove misleading 'exec' statement | expand

Commit Message

Christian Eggers Sept. 10, 2024, 7:34 a.m. UTC
As this script fragment is sourced by another script (swupdate.sh), we
do not want to replace the current shell by swupdate-progress. The shell
indeed doesn't do this due to the '&' at the end of the command. So the
'exec' statement seems to have no effect and should be removed in favor
of clarity.

Signed-off-by: Christian Eggers <ceggers@arri.de>
---
Please apply to all branches.

 recipes-support/swupdate/swupdate/90-start-progress | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic Sept. 10, 2024, 9:28 a.m. UTC | #1
Hi Christian,

On 10.09.24 09:34, Christian Eggers wrote:
> As this script fragment is sourced by another script (swupdate.sh), we
> do not want to replace the current shell by swupdate-progress. The shell
> indeed doesn't do this due to the '&' at the end of the command. So the
> 'exec' statement seems to have no effect and should be removed in favor
> of clarity.
>

Let's see, because this does not happen very often.

90-start-progress is not installed on systems with Systemd as
virtual/init_manager. It remains as fallback with SystemV (or other init
systems) and just in that case it is started by system.sh. But this is
maybe the cause.

Instead of this, does it makes more sense to have a swupdate-progress
init script (with own start/stop/restart) ? swupdate.sh is thought to
start just the SWUpdate daemon, and it starts the progress because in
the past they were started from the same script, probably due to
laziness (from me...).  Having a single SystemV script running two
daemons is pretty unusual and I can just imagine I did this because I
was on hurry.

Best regards,
Stefano Babic

> Signed-off-by: Christian Eggers <ceggers@arri.de>
> ---
> Please apply to all branches.
>
>   recipes-support/swupdate/swupdate/90-start-progress | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/recipes-support/swupdate/swupdate/90-start-progress b/recipes-support/swupdate/swupdate/90-start-progress
> index 3b0eb5e7d7c9..d574ce5dd660 100644
> --- a/recipes-support/swupdate/swupdate/90-start-progress
> +++ b/recipes-support/swupdate/swupdate/90-start-progress
> @@ -1 +1 @@
> -exec /usr/bin/swupdate-progress -w -r &
> +/usr/bin/swupdate-progress -w -r &
Christian Eggers Sept. 10, 2024, 10:52 a.m. UTC | #2
Hi Stefano,

On Tuesday, 10 September 2024, 11:28:01 CEST, Stefano Babic wrote:
> Hi Christian,
> 
> On 10.09.24 09:34, Christian Eggers wrote:
> > As this script fragment is sourced by another script (swupdate.sh), we
> > do not want to replace the current shell by swupdate-progress. The shell
> > indeed doesn't do this due to the '&' at the end of the command. So the
> > 'exec' statement seems to have no effect and should be removed in favor
> > of clarity.
> >
> 
> Let's see, because this does not happen very often.
> 
> 90-start-progress is not installed on systems with Systemd as
> virtual/init_manager. It remains as fallback with SystemV (or other init
> systems) and just in that case it is started by system.sh. But this is
> maybe the cause.

In my case it's busybox init which starts swupdate.sh ...

> 
> Instead of this, does it makes more sense to have a swupdate-progress
> init script (with own start/stop/restart) ? swupdate.sh is thought to
> start just the SWUpdate daemon, and it starts the progress because in
> the past they were started from the same script, probably due to
> laziness (from me...).  Having a single SystemV script running two
> daemons is pretty unusual and I can just imagine I did this because I
> was on hurry.

Of course, a separate init script for swupdate-progress would also make sense.
As a bonus, swupdate-progress can be started AFTER the swupdate daemon
which would make more sense.

As I have just removed the swupdate-progress package from my system, the
result doesn't matter for me. I only created this patch to increase clarity
for other users.

regards,
Christian

> 
> Best regards,
> Stefano Babic
> 
> > Signed-off-by: Christian Eggers <ceggers@arri.de>
> > ---
> > Please apply to all branches.
> >
> >   recipes-support/swupdate/swupdate/90-start-progress | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/recipes-support/swupdate/swupdate/90-start-progress b/recipes-support/swupdate/swupdate/90-start-progress
> > index 3b0eb5e7d7c9..d574ce5dd660 100644
> > --- a/recipes-support/swupdate/swupdate/90-start-progress
> > +++ b/recipes-support/swupdate/swupdate/90-start-progress
> > @@ -1 +1 @@
> > -exec /usr/bin/swupdate-progress -w -r &
> > +/usr/bin/swupdate-progress -w -r &
> 
>
Stefano Babic Sept. 10, 2024, 10:54 a.m. UTC | #3
On 10.09.24 12:52, Christian Eggers wrote:
> Hi Stefano,
>
> On Tuesday, 10 September 2024, 11:28:01 CEST, Stefano Babic wrote:
>> Hi Christian,
>>
>> On 10.09.24 09:34, Christian Eggers wrote:
>>> As this script fragment is sourced by another script (swupdate.sh), we
>>> do not want to replace the current shell by swupdate-progress. The shell
>>> indeed doesn't do this due to the '&' at the end of the command. So the
>>> 'exec' statement seems to have no effect and should be removed in favor
>>> of clarity.
>>>
>>
>> Let's see, because this does not happen very often.
>>
>> 90-start-progress is not installed on systems with Systemd as
>> virtual/init_manager. It remains as fallback with SystemV (or other init
>> systems) and just in that case it is started by system.sh. But this is
>> maybe the cause.
>
> In my case it's busybox init which starts swupdate.sh ...
>
>>
>> Instead of this, does it makes more sense to have a swupdate-progress
>> init script (with own start/stop/restart) ? swupdate.sh is thought to
>> start just the SWUpdate daemon, and it starts the progress because in
>> the past they were started from the same script, probably due to
>> laziness (from me...).  Having a single SystemV script running two
>> daemons is pretty unusual and I can just imagine I did this because I
>> was on hurry.
>
> Of course, a separate init script for swupdate-progress would also make sense.

+1

> As a bonus, swupdate-progress can be started AFTER the swupdate daemon
> which would make more sense.

+1

>
> As I have just removed the swupdate-progress package from my system, the
> result doesn't matter for me. I only created this patch to increase clarity
> for other users.

ok - I will write somewhere (maybe in improvements) that this should be
solved, so that this won't be forgotten.

Best regards,
Stefano

>
> regards,
> Christian
>
>>
>> Best regards,
>> Stefano Babic
>>
>>> Signed-off-by: Christian Eggers <ceggers@arri.de>
>>> ---
>>> Please apply to all branches.
>>>
>>>    recipes-support/swupdate/swupdate/90-start-progress | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/recipes-support/swupdate/swupdate/90-start-progress b/recipes-support/swupdate/swupdate/90-start-progress
>>> index 3b0eb5e7d7c9..d574ce5dd660 100644
>>> --- a/recipes-support/swupdate/swupdate/90-start-progress
>>> +++ b/recipes-support/swupdate/swupdate/90-start-progress
>>> @@ -1 +1 @@
>>> -exec /usr/bin/swupdate-progress -w -r &
>>> +/usr/bin/swupdate-progress -w -r &
>>
>>
>
>
>
>
diff mbox series

Patch

diff --git a/recipes-support/swupdate/swupdate/90-start-progress b/recipes-support/swupdate/swupdate/90-start-progress
index 3b0eb5e7d7c9..d574ce5dd660 100644
--- a/recipes-support/swupdate/swupdate/90-start-progress
+++ b/recipes-support/swupdate/swupdate/90-start-progress
@@ -1 +1 @@ 
-exec /usr/bin/swupdate-progress -w -r &
+/usr/bin/swupdate-progress -w -r &