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

Message ID 20240327193920.14311-4-stefan.schantl@ipfire.org
State Staged
Commit b25236acf75f47999bc01885c35a0fc80a782023
Headers
Series [PATCHv2,1/4] initscripts: Add generic function to get the filesystem type of a volume |

Commit Message

Stefan Schantl March 27, 2024, 7:39 p.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 | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

Michael Tremer March 28, 2024, 10:31 a.m. UTC | #1
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>

> On 27 Mar 2024, at 19:39, 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 | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/initscripts/system/grub-btrfsd b/src/initscripts/system/grub-btrfsd
> index 26760f9be..49073a807 100644
> --- a/src/initscripts/system/grub-btrfsd
> +++ b/src/initscripts/system/grub-btrfsd
> @@ -33,16 +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
> - sleep 1;
> + killproc /usr/bin/grub-btrfsd
> ;;
> 
> restart)
> -- 
> 2.39.2
>
  

Patch

diff --git a/src/initscripts/system/grub-btrfsd b/src/initscripts/system/grub-btrfsd
index 26760f9be..49073a807 100644
--- a/src/initscripts/system/grub-btrfsd
+++ b/src/initscripts/system/grub-btrfsd
@@ -33,16 +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
-		sleep 1;
+		killproc /usr/bin/grub-btrfsd
 	;;
 
 	restart)