How to sychronize service START with STOP of mount units?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

We'd like to implement a factory reset for an embedded device we are working on.

I think the cleanest approach would be a factory-reset.target which WANTS/REQUIRES reboot.target + a factory-reset.service which wipes the persistent storage.

The thing is, START of factory-reset.service would need to be synchronized with the STOPs of some mount units which got started during system boot.

For easier understanding:

System start:
1. Start path-to-first.mount
2. Start path-to-second.mount

System halt:
1. Stop path-to-second.mount
2. Stop path-to-first.mount

Factory reset:
1. Stop path-to-second.mount
2. Start factory-reset.service, wiping /path/to/first/*
3. Stop path-to-first.mount

I currently have no idea how to express this in systemd terms. If someone on this list could provide some advice, it would be much appreciated.

Thanks in advance and best regards,
Manuel



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux