Linux exercise 11 - Systemd

  1. How do you stop SSH service with systemd and make sure it won't start during system bootup? Do this task and verify it by booting the system. (Important: do not do this if you are using VLE environment, but rathet only write how you would do this!)
  2. Create a scheduled task with systemd which writes date command output into the file date.txt on user's home directory every two minutes on current day each week. For example if now is tuesday, date information will be written on every tuesday on every week.
  3. Check help for systemctl command. How can you only list enabled unit files that are services?
  4. Install Apache2 web server to your Ubuntu with apt package management. With what name was this service installed as systemd service? Web server is started during system bootup by default and listens to port 80. Change systemd setting for this service so that it will not be started automatically during system bootup. Reboot the system and verify that web server has not been started (port 80 is not listened).
  5. Create a directory called backup to your home directory. Now create a regular backup with systemd so that the following files from /var/log directory will be added to backup.tar.gz archive every day (you may choose the time this occurs daily) and saved into the backup directory inside your home directory:
    • auth.log
    • kern.log
    • faillog