Files
usb-ssd/examples/systemd-services/ssd-automount.service
2025-08-07 19:28:22 +02:00

46 lines
1.0 KiB
Desktop File

[Unit]
Description=Automatic SSD Mounting Service
Documentation=https://git.gitcover.de/KMU/usb-ssd
After=ssd-detection.service
Requires=ssd-detection.service
BindsTo=ssd-detection.service
[Service]
Type=forking
User=root
Group=root
ExecStart=/usr/local/bin/ssd-mount-manager.sh mount --auto-mount
ExecStop=/usr/local/bin/ssd-safe-eject.sh --all
ExecReload=/usr/local/bin/ssd-mount-manager.sh remount
PIDFile=/var/run/ssd-automount.pid
Restart=on-failure
RestartSec=10
TimeoutStartSec=60
TimeoutStopSec=30
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=ssd-automount
# Security
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/log /var/run /mnt /media
PrivateTmp=true
PrivateDevices=false
DevicePolicy=closed
DeviceAllow=/dev/sd* rw
DeviceAllow=/dev/disk/by-uuid/* rw
# Environment
Environment=SSD_LOG_LEVEL=INFO
Environment=SSD_USE_SYSLOG=true
Environment=SSD_AUTO_MOUNT=true
Environment=SSD_MOUNT_POINT=/mnt/ssd-storage
[Install]
WantedBy=multi-user.target
Also=ssd-detection.service