Monday, October 20, 2014

systemd services

systemd services are replacements of old init.d scripts. To create one this is an awesome post by "kezhang"@wordpress. tnx guy...

http://kezhong.wordpress.com/2011/11/19/creating-my-own-systemd-service-files-on-fedora-16x86_64/

Just a copy and paste:
  1. Create any script file or program to be run
  2. Give it execute permission
  3. Create the service file:
    # vi /lib/systemd/system/<name>.service
      [Unit]
      Description=Desired text of description
      After=syslog.target network.target
      [Service]
      Type=simple
      ExecStart=<executable address>
      [Install]
      WantedBy=multi-user.target

  4. Make symbolic link
      # ln -s /lib/systemd/system/radinfo.service cd /etc/systemd/system/radinfo.service
  5. Make systemd take notice of it
      # systemctl daemon-reload
  6. Activate a service immediately
      # systemctl start radinfo.service
  7. Enable a service to be started on bootup
      # systemctl enable radinfo.service

No comments:

Post a Comment