[dev] Remount rootfs sync on impending battery depletion.

2010-12-04 Thread Antoni Grzymala
Hi, just wanted to share a simple idea here – a little feature implemented in my statusbar script: remount the rootfs sync, when the battery level is below some predefined threshold and falling. I somehow find it less distracting than warnings popping up and less annoying then a forced poweroff u

Re: [dev] Remount rootfs sync on impending battery depletion.

2010-12-04 Thread Gene Auyeung
Hi, Just curious, how would the script get permission to mount? You can't type the password for sudo because it's not interactive. And you can't rely on the limited time that sudo grants access if you run the script with sudo, because presumably the battery lasts much longer than that? Thanks, Ge

Re: [dev] Remount rootfs sync on impending battery depletion.

2010-12-04 Thread Troels Henriksen
Gene Auyeung writes: > Hi, > > Just curious, how would the script get permission to mount? You can't > type the password for sudo because it's not interactive. And you can't > rely on the limited time that sudo grants access if you run the script > with sudo, because presumably the battery lasts

Re: [dev] Remount rootfs sync on impending battery depletion.

2010-12-04 Thread Antoni Grzymala
Gene Auyeung dixit (2010-12-04, 11:23): > Just curious, how would the script get permission to mount? You can't > type the password for sudo because it's not interactive. And you can't > rely on the limited time that sudo grants access if you run the script > with sudo, because presumably the batt

Re: [dev] Remount rootfs sync on impending battery depletion.

2010-12-04 Thread Gene Auyeung
On Sat, Dec 4, 2010 at 11:29 AM, Antoni Grzymala wrote: > Simplest way: > >  ALL=(ALL) NOPASSWD: ALL > > The safer way would obviously be if you limit this to /bin/mount. Ah yes I forgot about that. It's more configuration, but I guess there's no getting around that. Thanks, Gene