On Wed, Jul 31, 2013 at 01:14:08PM +0100, lux-integ wrote: > > I am trying to learn systemD. I scaned through some of the man pages. I am > here asking if systemD unit file synthesis can be made to support macros; > > for example of the following type:- > > #-------------- > IF mountpoint exists > /bin/mount /dev/something $mountpoint > ELSE > /bin/mount /dev/something somewherelse > ENDiF > #--------------
You can split the logic into two mount units with opposite Condition #mountpoint.mount [Unit] Description=mount mountpoint ConditionPathIsMountPoint=/mountpoint [Mount] What=/dev/something Where=/mountpoint #somewherelse.mount [Unit] Description=mount somewhereelse ConditionPathIsMountPoint=!/mountpoint [Mount] What=/dev/something Where=/somewhereelse See man systemd.mount and man systemd.exec for details. http://www.freedesktop.org/software/systemd/man/systemd.mount.html http://www.freedesktop.org/software/systemd/man/systemd.unit.html Regards Michal Vyskocil > > thanks in advance > LuxInteg > _______________________________________________ > systemd-devel mailing list > systemd-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/systemd-devel
signature.asc
Description: Digital signature
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel