Setup installation
This commit is contained in:
45
examples/systemd-services/ssd-automount.service
Normal file
45
examples/systemd-services/ssd-automount.service
Normal file
@@ -0,0 +1,45 @@
|
||||
[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
|
Reference in New Issue
Block a user