Open palisadoes opened 4 years ago
Would storing the unit paths for both systems as variables, then using a conditional statement to place the files in the appropriate directory for the respective system? (or should I try to make it more flexible for future linux distributions?
Make it flexible for any distribution. There is no guarantee of flawless installation otherwise
On Mon, Jun 1, 2020, 9:51 PM Jason Gayle notifications@github.com wrote:
Would storing the unit paths for both systems as variables, then using a conditional statement to place the files in the appropriate directory for the respective system? (or should I try to make it more flexible for future linux distributions?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PalisadoesFoundation/pattoo/issues/299#issuecomment-637270680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAYCGZKD754SYTY6VGNTBDRUSAN3ANCNFSM4NQL3AVA .
The location for systemd unit files are different for Centos and Ubuntu. The current installation script only places the files in the Ubuntu location, which does not exist in CentOS. The respective locations are:
/lib/systemd/system
/usr/lib/systemd/system
One way of determining the correct location is to run this CLI command, which will return a search path list of directories where the files are expected to be located.
systemctl show -p UnitPath
Which will give a response like this for Centos:
UnitPath=/etc/systemd/system /run/systemd/system /run/systemd/generator /usr/local/lib/systemd/system /usr/lib/systemd/system /run/systemd/generator.late
And like this for Ubuntu:
UnitPath=/etc/systemd/system.control /run/systemd/system.control /run/systemd/transient /run/systemd/generator.early /etc/systemd/system /etc/systemd/system.attached /run/systemd/system /run/systemd/system.attached /run/systemd/generator /usr/local/lib/systemd/system /lib/systemd/system /usr/lib/systemd/system /run/systemd/generator.late
The systed files should not be placed in any directory with the following strings:
/run
/etc
/local
This should usually leave one or two options, one or more of which may not exist. The files should be placed in the remaining directory that does exist.