init
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Montage du système de fichiers imapsync_cache
|
||||
Before=imapsync.service
|
||||
|
||||
[Mount]
|
||||
What=/home/migration/migration-dinum/imapsync_cache_fs.img
|
||||
Where=/home/migration/migration-dinum/imapsync_cache
|
||||
Type=ext4
|
||||
Options=loop
|
||||
DirectoryMode=0755
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,26 @@
|
||||
[Unit]
|
||||
Description=Mon script Python avec montage requis
|
||||
After=network.target home-migration-migration\x2ddinum-imapsync_cache.mount
|
||||
Requires=home-migration-migration\x2ddinum-imapsync_cache.mount
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
# L'utilisateur et le groupe qui exécuteront le script
|
||||
User=migration
|
||||
Group=migration
|
||||
|
||||
# Changement de répertoire (Equivalent d'un 'cd')
|
||||
WorkingDirectory=/home/migration/migration-dinum/
|
||||
|
||||
# L'environnement (optionnel, utile pour le buffer Python)
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
|
||||
# Commande à lancer (Utilisez TOUJOURS les chemins absolus)
|
||||
ExecStart=/usr/bin/python3 /home/migration/migration-dinum/imapsync_daemon.py
|
||||
|
||||
# Comportement en cas de crash
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user