0

I am trying to run a mount script using systemd. It did run but the mount point doesn't appear (/with). If I execute /usr/local/sbin/utils-start.bash manually, it works.

/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.
1

I found the problem. I had to run

systemctl enable test2d

else it wouldn't work.

4
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review May 5 '17 at 11:58
  • @SumeetDeshmukh it sure looks like an answer to me
    – Zanna
    May 5 '17 at 13:01
  • @Zanna I'll need to learn this first, I wanted to mark it as Less descriptive or something, My 6 hours of Review experience isn't something to brag about I guess May 5 '17 at 13:10
  • 1
    @SumeetDeshmukh thank you very much for reviewing. Many people do not do it at all, and it's very important to the site :) of course it takes practice. Also, I am often wrong about stuff. You are not the only reviewer who recommended deletion of this. But I think this was the solution in OP's case.
    – Zanna
    May 5 '17 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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