View previous topic :: View next topic |
Author |
Message |
sdauth l33t
Joined: 19 Sep 2018 Posts: 645 Location: Ásgarðr
|
Posted: Thu Sep 19, 2024 2:36 pm Post subject: [SOLVED] [openrc] verbose localmount service |
|
|
Hello,
I wanted to have a little more output when localmount sevice because I have a lot of drives and during boot of my system when the service starts, it stays quiet for a while at:
Code: | Mounting local filesystems ... |
So I added "v" to the mount command in the localmount init file, it works but as the command uses "a" (for all), it also output ignored mountpoint (those using noauto)
Code: | start()
{
[...]
ebegin "Mounting local filesystems"
mount -vat "$types" $no_netdev
[...] |
How can I filter the ignored mountpoint from being shown ?
Last edited by sdauth on Thu Sep 19, 2024 5:08 pm; edited 1 time in total |
|
Back to top |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 645 Location: Ásgarðr
|
Posted: Thu Sep 19, 2024 4:20 pm Post subject: |
|
|
simple as:
Code: | mount -vat "$types" $no_netdev | grep -v 'ignor' |
(not sure why I was trying to complicate things here )
edit: Well, it works...
Code: | * Mounting local filesystems ...
/home : successfully mounted
/swap : successfully mounted
/mnt/data : successfully mounted
/var/cache/distfiles : successfully mounted
/var/cache/binpkgs : successfully mounted
/mnt/DRIVES/DATA : successfully mounted
/mnt/DRIVES/VM : successfully mounted
/mnt/DRIVES/VM2 : successfully mounted
etc...
|
but, the output is shown when everything is fully processed instead of printing line by line. (Similar to what dmcrypt init does)
Any idea to achieve this ? |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22619
|
Posted: Thu Sep 19, 2024 4:43 pm Post subject: |
|
|
Output is probably being buffered since stdout is a pipe, not a file. Does it help if you use stdbuf to force line buffering? |
|
Back to top |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 645 Location: Ásgarðr
|
Posted: Thu Sep 19, 2024 5:07 pm Post subject: |
|
|
Nice Hu ! Thanks a lot, it works perfectly.
Code: | stdbuf -oL mount -vat "$types" $no_netdev | grep -v 'ignor' |
|
|
Back to top |
|
|
|