jcnelson / vdev

A device-file manager for *nix
GNU General Public License v3.0
101 stars 13 forks source link

OpenRC init script #27

Open jcnelson opened 9 years ago

jcnelson commented 9 years ago

Add one, and update the Makefile options to allow the user to pick whether or not to install a System V or an OpenRC init script.

geki-yaba commented 9 years ago

Since noone stepped up until now, I may post what I came up with. Sadly, it is incomplete. But if anyone else wants to complete, the skeleton is done. I may complete this, if I move my system from mdev to vdevd. That can take some time. So, I hope this is still some help. I am going to attach the /etc/conf.d/vdev and /etc/init.d/vdevd files.

A fine resource to complete the OpenRC init script can be found here: https://gitweb.gentoo.org/proj/udev-gentoo-scripts.git/tree/

geki-yaba commented 9 years ago

/etc/conf.d/vdevd

VDEV_BIN="/sbin/vdevd" VDEV_OPTS="" VDEV_CONFIG="/etc/vdev/vdevd.conf" VDEV_MOUNTPOINT="/dev"

geki-yaba commented 9 years ago

Well, better not paste the init file. The config and init files can be found here: http://geki.selfhost.eu/vdevd/conf.d/vdevd http://geki.selfhost.eu/vdevd/init.d/vdevd

jcnelson commented 9 years ago

Hey, this is really cool! Thanks for taking the time to attack this problem!

When I get a chance, I'll give this a try on an OpenRC system.

tokiclover commented 9 years ago

I've just finished making a sys-fs/vdev package for Gentoo (derivative) distro; and so included OpenRC init script for vdevd only for now. I'd see later for vdevfs...

Init script are under GPL-2 but can be integrated in the upstream package if need with ISC or whatever license if need be.

Phew, finished at last... I could not get geki's ones.

tokiclover commented 9 years ago

Here is the missing link sys-fs/vdev!

geki-yaba commented 9 years ago

yes, sadly, dns is down. will be up later hopefully. I guess I will have to try gist.

geki-yaba commented 9 years ago

dns is up again ... once a year ddclient hangs.

geki-yaba commented 9 years ago

gist is interesting, indeed. https://gist.github.com/geki-yaba/

tokiclover commented 9 years ago

@geki-yaba: your version is practically a transcription from upstream example... OpenRC init script does not need all that stuff. So I've took the liberty to remove unecessary stuff on the variant mentioned above. Especially, the start() function wich is not needed once command{,_args} is defined which is more than enough here.

jcnelson commented 9 years ago

Hi @tokiclover

Thank you for taking a look at this!

I notice that in the start_pre() method in the initd file (https://github.com/tokiclover/bar-overlay/blob/master/sys-fs/vdev/files/vdevd.initd), you try to mount devtmpfs. While this is perfectly fine, you might be interested to know that vdevd does not require devtmpfs to work (whereas udev does). This can be useful, because when using a vanilla tmpfs, programs can use inotify(7) to watch /dev for device file creation/deletion (not possible with devtmpfs).

-Jude

tokiclover commented 9 years ago

@jcnelson: That start_pre() is just a set up function that is usefull only as a safety net; only, the last lines--for loop--is really usefull. Or else, in case this is necessary depending on the setup container or not et al. Mounting /dev is handled by dev-mount service dependency when using OpenRC. (See depend() function.) So, there won't be any mounting here but only a safety net to be able to boot whatever may happen.

Setting up a tmpfs is open... to discussion. It's just that devtmpfs became the default recently(really?) with udev. So, if inotify(7) is usefull here, setting up a tmpfs may be necessary. But this should be done in dev-mount init service. And do notice that a fallback to tmpfs is also available.

jcnelson commented 9 years ago

And do notice that a fallback to tmpfs is also available.

Yes, I see that :)

My earlier comment was only made to bring attention to an interesting feature that can be had by using tmpfs. I was not trying to suggest that there's anything wrong with the initscript you wrote :)