On Mon, 7 Mar 2016 20:30, Greg Freemyer wrote:
On Mon, Mar 7, 2016 at 1:59 PM, Yamaban wrote:
On Mon, 7 Mar 2016 19:41, Greg Freemyer wrote:
On Mon, Mar 7, 2016 at 12:01 PM, Anton Aylward wrote:
On 03/07/2016 10:50 AM, Per Jessen wrote:
Greg Freemyer wrote:
[snip] Oh! how about a workaround:
/etc/fstab: (added noauto to options) /srv_new/portal_backup_container /home/portal_backup/portal_backup ext4 noauto,loop 0 0
and for the service that uses this mount (added to the .service file): [Service] ExecPreStart=/bin/sh -c 'test -d /home/portal_backup/portal_backup || mkdir -p /home/portal_backup/portal_backup' ExecPreStart=/bin/sh -c 'grep /home/portal_backup/portal_backup /proc/mounts || mount /home/portal_backup/portal_backup'
this two parts should ensure that a) your system boots normally, b) is the mount is not there, no other service is hurt c) the service that NEEDs the mount can do the mount itself.
Thanks,
I will definitely add "noauto".
As to the "service". I will have to think about that. Currently another VM in the same data center is sending this machine a backup and it just does a scp to the mounted filesystem, so there isn't an obvious service to add your script to.
Maybe I will just put similar lines in .profile (or .bashrc) for the dedicated backup_user account.
Two way to get around that: First way create script that does the mount-point check and the mount, call this script either internall via a) internally via cron (with @reboot, add delay in script if needed) b) external via call from ssh before the scp starts Second way Create a 'portal_backup.service' file with [code] ====================== [Unit] Description="mount the loopback portal_backup independly" After=sshd.service postfix.service JobTimeoutSec=15 RequiresMountsFor=/home [Service] Type=oneshot ExecPreStart=/bin/sh -c 'test -d /home/portal_backup/portal_backup || mkdir -p /home/portal_backup/portal_backup' ExecStart=/bin/sh -c '/usr/bin/grep /home/portal_backup/portal_backup /proc/mounts || /usr/bin/mount /home/portal_backup/portal_backup' ExecStop=/usr/bin/umount /home/portal_backup/portal_backup [Install] ======================== [/code] and either create a portal_backup.timer (OnBootSec= or OnStartupSec=) or a call from cron (@reboot), or simply 'enable' this service IMHO a .service is the best way to go, you can call that via .timer, from cron (systemctl) or from ssh (also systemd) also if you get some Dependencies in (After=) you can add a general 'enable' for that. - Yamaban. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org