[arch-general] moving custom hooks to systemd

Dimitrios Apostolou jimis at gmx.net
Fri Aug 31 14:19:38 EDT 2012


Hello list,

I tried booting with systemd and two custom hooks I have that create the 
/var directory on tmpfs didn't work. Google doesn't help here and my 
experience with systemd is in its infancy, so is there specific action I 
should take?

My custom hooks are set to run during sysinit_postmount and 
shutdown_preumount, see attached file for full source.


Thanks in advance,
Dimitris
-------------- next part --------------
function varsync_start ()
{
	# Assuming that we mounted /var as tmpfs in the previous step
	stat_busy "Rsyncing /var-sync/ to /var/"
	/usr/bin/rsync -ax /var-sync/ /var/
	stat_done
}

function varsync_stop ()
{
	# saving the /var filesystem from the tmpfs
	echo -e 'y\ny' | /usr/bin/pacman -Scc >/dev/null
	stat_busy "Rsyncing /var/ to /var-sync/"
	/usr/bin/rsync -ax --delete /var/ /var-sync/
	stat_done
}

add_hook sysinit_postmount varsync_start
add_hook shutdown_preumount varsync_stop


More information about the arch-general mailing list