Location of systemd unit files /lib/systemd/system - The system's copy of unit files are generally kept in this directory. When software installs unit files on the system, this is the location where they are placed by default. /run/systemd/system - Systemd unit files created at run time. This directory takes precedence over the directory with installed service unit files. /etc/systemd/system/ - If you wish to modify the way that a unit functions, the best location to do so is within this directory.
SystemD is a system and service manager for Linux operating systems. It is designed to be backwards compatible with SysV init scripts, and provides a number of features such as parallel startup of system services at boot time, on-demand activation of daemons, or dependency-based service control logic.
Previous versions of Linux distributions like Debian or Ubuntu, which were distributed with SysV init or Upstart, used init scripts located in the /etc/rc.d/init.d/ directory. These init scripts were typically written in Bash, and allowed the system administrator to control the state of services and daemons in their system. With systemd these init scripts have been replaced with service units. Service units end with the .service file extension and serve a similar purpose as init scripts.