

This entry was posted in Linux and tagged Arch, systemd. Main PID: 29371 (code=exited, status=0/SUCCESS)įeb 13 18:47:47 archbox sSMTP: Creating SSL connection to hostįeb 13 18:47:47 archbox sSMTP: SSL connection using AES256-GCM-SHA384įeb 13 18:47:48 archbox sSMTP: Sent mail for (221 closing connection) uid=0 username=root outbytes=531įeb 13 18:47:51 archbox systemd: Started Email After Reboot. Process: 29371 ExecStart=/bin/bash /root/.myscripts/email-on-reboot.sh (code=exited, status=0/SUCCESS) Utilities homectl homectl is the main utility you will use for homed. However, you must enable and start the rvice. The pambase package since version 20200721.1-2 comes with the necessary PAM configuration to allow systemd-homed user sessions. Loaded: loaded (/etc/systemd/system/rvice enabled)Īctive: inactive (dead) since Thu 18:47:51 GMT 48s ago Installation systemd-homed is part of and packaged with systemd. Start the email-on-reboot service: # systemctl start rviceĬheck status of the service: # systemctl status rvice -lĮrvice - Email After Reboot Open for editing: # vim /etc/systemd/system/rviceĮxecStart=/bin/bash /root/.myscripts/email-on-reboot.shĮnable newly created email-on-reboot service: # systemctl enable rvice Set permissions on the file: # chmod 0644 /etc/systemd/system/rvice Open a new file for the script: # vim /root/.myscripts/email-on-reboot.shĮcho "My public IP is: $"|mail -S sendwait -s "RESTARTED: Back online" -r Ĭreate email-on-reboot named systemd service: # touch /etc/systemd/system/rvice ConfigurationĬreate a new directory to store script files: # mkdir /root/.myscripts If you need any help setting it up, please check Logwatch, SSMTP and Iptables or Arch Linux (Raspberry Pi) post. SSMTP configuration is beyond the scope of this article.

With SSMTP and mail applications: $ ssmtp -V mail -V As a bonus, email message will be configured to show a public IP address of the box. Getting around with systemd, we’ll create a service to send emails every time ArchLinux VM restarts.
