systemd mount script problem

0

Estou tentando executar um script de montagem usando o systemd. Ele foi executado, mas o ponto de montagem não aparece ( /with ). Se eu executar /usr/local/sbin/utils-start.bash manualmente, isso funciona.

/etc/systemd/system/test2d.service :

[Unit]
Description=test2d

[Service]
User=root
Type=oneshot
#Start script
ExecStart=/usr/local/sbin/utils-start.bash
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

/usr/local/sbin/utils-start.bash

/bin/mount -v --make-rshared /
/bin/mount -v --bind /with /with
/bin/mount -v --make-rprivate /with
/bin/mount -v -t tmpfs with-global /with

journalctl -xe result:

May 05 16:26:48 dev3 systemd[1]: test2d.service: Trying to enqueue job test2d.service/start/replace
May 05 16:26:48 dev3 systemd[1]: test2d.service: Installed new job test2d.service/start as 15762
May 05 16:26:48 dev3 systemd[1]: test2d.service: Enqueued job test2d.service/start as 15762
May 05 16:26:48 dev3 systemd[1]: Sent message type=method_return sender=n/a destination=n/a object=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 error=n/a
May 05 16:26:48 dev3 systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=JobNew cookie=2 reply_cookie=0 error=
May 05 16:26:48 dev3 systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=JobNew cookie=868731 reply_cookie=0 e
May 05 16:26:48 dev3 systemd[1]: test2d.service: Job test2d.service/start finished, result=done
May 05 16:26:48 dev3 systemd[1]: Started Initializes the file system namespaces for /usr/bin/with.
-- Subject: Unit test2d.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit test2d.service has finished starting up.
-- 
-- The start-up result is done.
    
por Thomas G. Lau 05.05.2017 / 10:34

1 resposta

2

Eu encontrei o problema. Eu tive que correr

systemctl enable test2d

senão não funcionaria.

    
por Thomas G. Lau 05.05.2017 / 12:37