Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I find systemd very exciting, but how would I use it to write a script to mount an s3ql filesystem? For example, the s3ql developer provides an upstart config that does the job.

Specifically, on startup mount.s3ql must be run (as the desired user as this is a FUSE filesystem), and on shutdown umount.s3ql must be run. In addition, what if we want to fsck.s3ql the filesystem before mounting, or run a Unison synchronization step after startup and before shutdown (all modifications I have made on my own personal upstart).

At first glance I would think I would want to setup a mount unit on systemd, but it appears that the service unit actually fits better with pre and post exec startup commands. (All the man pages are available here.)

And what .target do I depend on to encode the dependency on a network connection?

share|improve this question
up vote 1 down vote accepted

At first, it seems that for mount.s3ql and umount.s3ql, a generic .mount unit might be appropriate. Both the mount command and systemd support mount.fstype helpers when mounting. However, the helper must support the standard -o options method of passing options, which s3ql does not. Also, the same limitations apply as with /etc/fstab.

So you might actually be better with a .service unit that calls the desired commands:


ExecStart=/usr/sbin/mount.s3ql --authfile ${AUTHFILE} ${BUCKET} ${MOUNTPOINT}
ExecStop=/usr/sbin/umount.s3ql ${MOUNTPOINT}

Since there is no standard way of configuring networks, much less one that actually checks whether the connection is actually working, there is no standard systemd target for what you want. There is, though, but it might consider itself started when the connection is not available yet.

If you are using NetworkManager, your distribution might have included a unit that runs nm-online – for example, Arch calls it NetworkManager-wait-online.service.

share|improve this answer
mount.s3ql supports -o options (and always has). Recent versions also come with systemd notification support, so Type=forking is no longer correct. – Nikratio Mar 16 at 16:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.