Skip to content

piped busybox commands not working on ubuntu 21.04 #6

@derzahla

Description

@derzahla

Not really sure what to make of this. After I ssh in, run unlock, and enter my password. I have to manually kill "zfs load-key -a" which is running on the console, for the boot to commence.

none of the ps | grep <program> | grep -v grep | awk '{print $1}' are grabbing the pid.
When I tried ZPID=ps | grep zfs | grep -v "grep" | awk '{print $1}' , and then "echo $ZPID" , the output would simply be " ps | grep zfs | grep -v "grep" | awk '{print $1}'`" It is not being interpreted properly in the script for some reason. But I can run this command in busybox after unlocking and it will work as expected:

`BusyBox v1.30.1 (Ubuntu 1:1.30.1-6ubuntu2) built-in shell (ash)
Enter 'help' for a list of built-in commands.

unlock

Enter passphrase for 'ROOT':
1 / 1 key(s) successfully loaded
kill: you need to specify whom to kill
kill: you need to specify whom to kill
kill: you need to specify whom to kill
kill: you need to specify whom to kill

kill: you need to specify whom to kill

ps

PID USER VSZ STAT COMMAND
<... output truncated...>
626 root 10208 S /sbin/zfs load-key ROOT
634 root 4428 R /sbin/dropbear -Fs -j -p 2772
635 root 2304 S -sh
711 root 2304 R {ps} -sh

ps | grep zfs

626 root 10208 S /sbin/zfs load-key ROOT
713 root 2304 R grep zfs

ps | grep zfs | grep -v grep

626 root 10208 S /sbin/zfs load-key ROOT

ps | grep zfs | grep -v grep | awk '{print $1}'

626

echo $SHELL

/bin/sh

kill ps | grep zfs | grep -v grep | awk '{print $1}'

Connection to 158.101.33.93 closed by remote host.

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions