Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] [openrc] verbose localmount service
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 659
Location: Ásgarðr

PostPosted: Thu Sep 19, 2024 2:36 pm    Post subject: [SOLVED] [openrc] verbose localmount service Reply with quote

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
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 659
Location: Ásgarðr

PostPosted: Thu Sep 19, 2024 4:20 pm    Post subject: Reply with quote

simple as:
Code:
mount -vat "$types" $no_netdev | grep -v 'ignor'

(not sure why I was trying to complicate things here :oops:)

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22865

PostPosted: Thu Sep 19, 2024 4:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 659
Location: Ásgarðr

PostPosted: Thu Sep 19, 2024 5:07 pm    Post subject: Reply with quote

Nice Hu ! Thanks a lot, it works perfectly.

Code:
stdbuf -oL mount -vat "$types" $no_netdev | grep -v 'ignor'
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum