[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: LSB init scripts and multiple lines of output



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

martin f krafft wrote:
> I am faced with the problem on how to tackle multiline output from
> an init.d script, which I have just converted to LSB. Since the
> package is mdadm and RAID is kinda essential to those that have it
> configured, I'd rather not hide information but give the user the
> entire process.
> 
> In my ideal world, this is what it would look like:
> 
> Starting RAID devices ...
>   /dev/md0 has been started with 3 drives.
>   /dev/md1 has been started with 3 drives.
>   /dev/md2 assembled from 2 drives - need all 3 to start it
>   /dev/md3 assembled from 1 drive - not enough to start the array.
>   /dev/md4 has been started with 3 drives.
> ... done assembling RAID devices: failed.
> 
> I don't seem to be able to realise this with lsb-base, nor does it
> seem that they even provide for this. The alternative -- all in one
[...]

what about

$ cat raid
. /lib/lsb/init-functions

log_action_msg "Starting RAID devices ..."
log_action_msg "  /dev/md0 has been started with 3 drives."
log_action_msg "  /dev/md1 has been started with 3 drives."
log_action_msg "  /dev/md2 assembled from 2 drives - need all 3 to start it"
log_action_msg "  /dev/md3 assembled from 1 drive - not enough to start the array."
log_action_msg "  /dev/md4 has been started with 3 drives."
log_failure_msg "... done assembling RAID devices: failed."

$ ./raid
Starting RAID devices ...
  /dev/md0 has been started with 3 drives..
  /dev/md1 has been started with 3 drives..
  /dev/md2 assembled from 2 drives - need all 3 to start it.
  /dev/md3 assembled from 1 drive - not enough to start the array..
  /dev/md4 has been started with 3 drives..
* ... done assembling RAID devices: failed.


Best Regards,

	Andreas


- --
Andreas Fester
mailto:andreas@littletux.net
WWW: http://www.littletux.net
ICQ: 326674288
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEfyVLZ3bQVzeW+rsRAvD/AKCJza+5KPQOZ2wMVm/5upylsdcEjgCdFmT7
kfYIlW9IyE/Lcf4gZuWtzOU=
=HR7O
-----END PGP SIGNATURE-----



Reply to: