LINUX.ORG.RU

История изменений

Исправление gasinvein, (текущая версия) :

Мам смотри я без скриптов!

# /etc/systemd/system/mnt-samba-create.service
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/fallocate -l 1GB /opt/file_1gb
ExecStart=/sbin/mkfs.ext4 /opt/file_1gb
ExecStop=/bin/rm /opt/file_1gb
# /etc/systemd/system/mnt-samba.mount
[Unit]
Requires=mnt-samba-create.service
After=mnt-samba-create.service

[Mount]
What=/opt/file_1gb
Where=/mnt/samba
Type=ext4
# /etc/systemd/system/smb.service.d/override.conf
[Unit]
Requires=mnt-samba.mount
After=mnt-samba.mount

Исходная версия gasinvein, :

Мам смотри я без рук скриптов!

# /etc/systemd/system/mnt-samba-create.service
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/fallocate -l 1GB /opt/file_1gb
ExecStart=/sbin/mkfs.ext4 /opt/file_1gb
ExecStop=/bin/rm /opt/file_1gb
# /etc/systemd/system/mnt-samba.mount
[Unit]
Requires=mnt-samba-create.service
After=mnt-samba-create.service

[Mount]
What=/opt/file_1gb
Where=/mnt/samba
Type=ext4
# /etc/systemd/system/smb.service.d/override.conf
[Unit]
Requires=mnt-samba.mount
After=mnt-samba.mount