[4/4] grub-btrfsd: Drop redundant used PIDFILE mechanism

Message ID 20240327051520.8231-4-stefan.schantl@ipfire.org
State Superseded
Headers
Series [1/4] initscripts: Add generic function to get the filesystem type of a volume |

Commit Message

Stefan Schantl March 27, 2024, 5:15 a.m. UTC
  This case is already covered by the PID mechanism of the used functions

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 src/initscripts/system/grub-btrfsd | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Michael Tremer March 27, 2024, 10:15 a.m. UTC | #1
> On 27 Mar 2024, at 05:15, Stefan Schantl <stefan.schantl@ipfire.org> wrote:
> 
> This case is already covered by the PID mechanism of the used functions
> 
> Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
> ---
> src/initscripts/system/grub-btrfsd | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/initscripts/system/grub-btrfsd b/src/initscripts/system/grub-btrfsd
> index 26760f9be..5981c3a0a 100644
> --- a/src/initscripts/system/grub-btrfsd
> +++ b/src/initscripts/system/grub-btrfsd
> @@ -33,15 +33,14 @@ case "$1" in
> btrfs)
> 
> boot_mesg "Starting GRUB/Btrfs Daemon..."
> - loadproc -b -p "$PIDFILE" /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR"
> - echo "$!" > "$PIDFILE"
> + loadproc -b /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR"
> ;;
> esac
> ;;
> 
> stop)
> boot_mesg "Stopping grub-btrfsd..."
> - killproc -p "$PIDFILE" /usr/bin/grub-btrfsd
> + killproc -p /usr/bin/grub-btrfsd
> sleep 1;

Why is there a sleep here?

> ;;
> 
> -- 
> 2.39.2
>
  
Stefan Schantl March 27, 2024, 7:42 p.m. UTC | #2
Am Mittwoch, dem 27.03.2024 um 10:15 +0000 schrieb Michael Tremer:
> 
> 
> > On 27 Mar 2024, at 05:15, Stefan Schantl
> > <stefan.schantl@ipfire.org> wrote:
> > 
> > This case is already covered by the PID mechanism of the used
> > functions
> > 
> > Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
> > ---
> > src/initscripts/system/grub-btrfsd | 5 ++---
> > 1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/initscripts/system/grub-btrfsd
> > b/src/initscripts/system/grub-btrfsd
> > index 26760f9be..5981c3a0a 100644
> > --- a/src/initscripts/system/grub-btrfsd
> > +++ b/src/initscripts/system/grub-btrfsd
> > @@ -33,15 +33,14 @@ case "$1" in
> > btrfs)
> > 
> > boot_mesg "Starting GRUB/Btrfs Daemon..."
> > - loadproc -b -p "$PIDFILE" /usr/bin/grub-btrfsd --syslog
> > "$SNAPSHOTDIR"
> > - echo "$!" > "$PIDFILE"
> > + loadproc -b /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR"
> > ;;
> > esac
> > ;;
> > 
> > stop)
> > boot_mesg "Stopping grub-btrfsd..."
> > - killproc -p "$PIDFILE" /usr/bin/grub-btrfsd
> > + killproc -p /usr/bin/grub-btrfsd
> > sleep 1;
> 
> Why is there a sleep here?
Good catch, that's a classical orphaned piece of code when removing
some other stuff.

I'll handle it in a v2 patchset.
> 
> > ;;
> > 
> > -- 
> > 2.39.2
> > 
>
  
Michael Tremer March 28, 2024, 10:32 a.m. UTC | #3
It is almost as if there is something good about having this review process :)

> On 27 Mar 2024, at 19:42, Stefan Schantl <stefan.schantl@ipfire.org> wrote:
> 
> Am Mittwoch, dem 27.03.2024 um 10:15 +0000 schrieb Michael Tremer:
>> 
>> 
>>> On 27 Mar 2024, at 05:15, Stefan Schantl
>>> <stefan.schantl@ipfire.org> wrote:
>>> 
>>> This case is already covered by the PID mechanism of the used
>>> functions
>>> 
>>> Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
>>> ---
>>> src/initscripts/system/grub-btrfsd | 5 ++---
>>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>> 
>>> diff --git a/src/initscripts/system/grub-btrfsd
>>> b/src/initscripts/system/grub-btrfsd
>>> index 26760f9be..5981c3a0a 100644
>>> --- a/src/initscripts/system/grub-btrfsd
>>> +++ b/src/initscripts/system/grub-btrfsd
>>> @@ -33,15 +33,14 @@ case "$1" in
>>> btrfs)
>>> 
>>> boot_mesg "Starting GRUB/Btrfs Daemon..."
>>> - loadproc -b -p "$PIDFILE" /usr/bin/grub-btrfsd --syslog
>>> "$SNAPSHOTDIR"
>>> - echo "$!" > "$PIDFILE"
>>> + loadproc -b /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR"
>>> ;;
>>> esac
>>> ;;
>>> 
>>> stop)
>>> boot_mesg "Stopping grub-btrfsd..."
>>> - killproc -p "$PIDFILE" /usr/bin/grub-btrfsd
>>> + killproc -p /usr/bin/grub-btrfsd
>>> sleep 1;
>> 
>> Why is there a sleep here?
> Good catch, that's a classical orphaned piece of code when removing
> some other stuff.
> 
> I'll handle it in a v2 patchset.
>> 
>>> ;;
>>> 
>>> -- 
>>> 2.39.2
  

Patch

diff --git a/src/initscripts/system/grub-btrfsd b/src/initscripts/system/grub-btrfsd
index 26760f9be..5981c3a0a 100644
--- a/src/initscripts/system/grub-btrfsd
+++ b/src/initscripts/system/grub-btrfsd
@@ -33,15 +33,14 @@  case "$1" in
 			btrfs)
 
 				boot_mesg "Starting GRUB/Btrfs Daemon..."
-				loadproc -b -p "$PIDFILE" /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR"
-				echo "$!" > "$PIDFILE"
+				loadproc -b /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR"
 			;;
 		esac
 	;;
 
 	stop)
 		boot_mesg "Stopping grub-btrfsd..."
-		killproc -p "$PIDFILE" /usr/bin/grub-btrfsd
+		killproc -p /usr/bin/grub-btrfsd
 		sleep 1;
 	;;