dropbear.service 986 B

123456789101112131415161718192021222324252627
  1. [Unit]
  2. Description=Dropbear SSH daemon
  3. After=syslog.target network.target auditd.service
  4. [Service]
  5. # If /etc/dropbear is a symlink to /var/run/dropbear, and
  6. # - the filesystem is RO (i.e. we can not rm the symlink),
  7. # create the directory pointed to by the symlink.
  8. # - the filesystem is RW (i.e. we can rm the symlink),
  9. # replace the symlink with an actual directory
  10. ExecStartPre=/bin/sh -c '\
  11. if [ -L /etc/dropbear \
  12. -a "$(readlink /etc/dropbear)" = "/var/run/dropbear" ]; then \
  13. if rm -f /etc/dropbear >/dev/null 2>&1; then \
  14. mkdir -p /etc/dropbear; \
  15. else \
  16. echo "No persistent location to store SSH host keys. New keys will be"; \
  17. echo "generated at each boot. Are you sure this is what you want to do?"; \
  18. mkdir -p "$(readlink /etc/dropbear)"; \
  19. fi; \
  20. fi'
  21. EnvironmentFile=-/etc/default/dropbear
  22. ExecStart=/usr/sbin/dropbear -F -R $DROPBEAR_ARGS
  23. ExecReload=/bin/kill -HUP $MAINPID
  24. [Install]
  25. WantedBy=multi-user.target