Anyone have a systemd script to auto-mount S3QL on boot?

677 views
Skip to first unread message

Keebs

unread,
Jul 23, 2015, 1:18:49 PM7/23/15
to s3ql
Anyone have a systemd service script to auto-mount S3QL on boot?

I'm using CentOS 7.

Thanks!

Nikolaus Rath

unread,
Jul 24, 2015, 11:53:01 AM7/24/15
to s3...@googlegroups.com
On Jul 23 2015, Keebs <adms...@comcast.net> wrote:
> Anyone have a systemd service script to auto-mount S3QL on boot?
>
> I'm using CentOS 7.

Do you mean something like this?

[Unit]
ExecStart = mount.s3ql --fg s3:/... /mnt
ExecStop = umount.s3ql /mnt
TimeoutStopSec = 42

Best,
-Nikolaus

--
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

»Time flies like an arrow, fruit flies like a Banana.«

Keebs

unread,
Jul 31, 2015, 10:16:52 AM7/31/15
to s3ql, Niko...@rath.org


Yes, but don't we need something to specify when the run the service?

For instance, the old script contained:

start on (filesystem and net-device-up IFACE=eth0)

That is where I'm getting hung up....

TY

MrNewman64

unread,
Sep 28, 2015, 2:42:09 AM9/28/15
to s3ql, Niko...@rath.org
I have a similar problem where I need to mount a cifs file system BEFOREI can mount an s3ql FS because the s3ql fs lives on the cifs fs

If I run s3ql mount AFTER booting , it works

but during boot it complains ..

cat /var/log/syslog | grep s3qlXXXX
...
Sep 28 13:51:24 uvaultcontrol s3qlXXXX: ZZZZZZZZZZZZZZZZZZZZZZZ START
Sep 28 13:51:24 uvaultcontrol s3qlXXXX: starting fsck.s3ql --batch local:///mnt/lenovo/1tera/S3QLFS/
Sep 28 13:52:00 uvaultcontrol s3qlXXXX: '/mnt/lenovo/1tera/S3QLFS' does not exist

here is the s3ql.conf file ..


start on (filesystem and net-device-up IFACE=eth0)
stop on runlevel [016]

# env BUCKET="s3://mybucket"
# env MOUNTPOINT="/mnt/s3/bucket"
env BUCKET="local:///mnt/lenovo/1tera/S3QLFS/"
env MOUNTPOINT="/mnt/s3qlfs"

expect stop

script
    # Redirect stdout and stderr into the system log
        DIR=$(mktemp -d)
        mkfifo "$DIR/LOG_FIFO"
        logger -t s3qlXXXX -p local0.info < "$DIR/LOG_FIFO" &
        exec > "$DIR/LOG_FIFO"
        exec 2>&1
        rm -rf "$DIR"

    # Check and mount file system
        echo ZZZZZZZZZZZZZZZZZZZZZZZ START
        echo "starting fsck.s3ql --batch $BUCKET"
        fsck.s3ql --batch "$BUCKET"
        exec mount.s3ql --upstart --allow-other "$BUCKET" "$MOUNTPOINT"
end script

pre-stop script
        echo "unmounting $MOUNTPOINT"
        umount.s3ql "$MOUNTPOINT"
end script


I have put the start script in/etc/init/s3ql.conf

## how do I make s3ql wait untill the mounts in fstab have completed ?
Reply all
Reply to author
Forward
0 new messages