Skip to Content [alt-c]

Comment

In reply to Comment by Anonymous

Anonymous on 2016-10-06 at 08:47:

wouldn’t it be enough to have a simple syntax which can do everything systemd init syntax can?

Something like this?

MOUNTPOINT=/sys/fs/fuse/connections depend() { need localmount } start() { ebegin "Starting fuse" if ! grep -qw fuse /proc/filesystems; then modprobe fuse >/dev/null 2>&1 || eerror $? "Error loading fuse module" fi if grep -qw fusectl /proc/filesystems && \ ! grep -qw $MOUNTPOINT /proc/mounts; then mount -t fusectl none $MOUNTPOINT >/dev/null 2>&1 || \ eerror $? "Error mounting control filesystem" fi eend ${?} } stop() { ebegin "Stopping fuse" if grep -qw $MOUNTPOINT /proc/mounts; then umount $MOUNTPOINT >/dev/null 2>&1 || \ eerror $? "Error unmounting control filesystem" fi eend ${?} }

That’s the syntax of OpenRC. You’ll notice the declarative dependencies along with the simple scripting in start() and stop().

And since it’s a scripting language, the answer to "can it do everything systemd can" is simply: Yes, it can.

A simple standard along with some convenience functions and building on existing tools already provides most of the functionality of systemd.

Reply

Post a Reply

Your comment will be public. To contact me privately, email me. Please keep your comment polite, on-topic, and comprehensible. Your comment may be held for moderation before being published.

(Optional; will be published)

(Optional; will not be published)

(Optional; will be published)

  • Blank lines separate paragraphs.
  • Lines starting with > are indented as block quotes.
  • Lines starting with two spaces are reproduced verbatim (good for code).
  • Text surrounded by *asterisks* is italicized.
  • Text surrounded by `back ticks` is monospaced.
  • URLs are turned into links.
  • Use the Preview button to check your formatting.