Changes

From SME Server
Jump to navigationJump to search
2,049 bytes added ,  19:08, 4 July 2022
Line 205: Line 205:  
  service nut start
 
  service nut start
 
Details: [[bugzilla:2738]]
 
Details: [[bugzilla:2738]]
 +
 +
===Manualy install a service on SME 10 and newer===
 +
Starting SME 10 systemd is in used, but there are some backward compatibility for sysvinit and daemontools managed service.
 +
Prefered way to install a non core service is by using a contrib, but if you need to run a service without any contrib available, then here are the steps.
 +
First check if the rpm providing the service includes either a /etc/rc.d/init.d/'''servicename''' or a /usr/lib/systemd/system/'''servicename'''.service files. Replace '''servicename''' by the appropriate name.
 +
 +
====Global steps====
 +
Create a db entry in configuration db:
 +
  config set servicename service status enabled
 +
 +
====only systemd .service file available====
 +
Create a dropin file to have this service available under sme-server.target as this is our target, we do not use the regular multi-user.target.
 +
mkdir -p  /etc/lib/systemd/system/'''servicename'''.service.d/
 +
printf "[Install]\nWantedBy=sme-server.target\n" > /etc/lib/systemd/system/'''servicename'''.service.d/50koozali.conf
 +
/etc/e-smith/events/actions/systemd-default
 +
 +
NB: in a contrib, we would use the /usr/lib/systemd/system/'''servicename'''.service.d/50koozali.conf path as it would be provided by an rpm and not by end-user admin.
 +
 +
====both systemd .service and /etc/rc.d/init.d/'''servicename''' files available====
 +
You need to hide the file in init.d from SME Server internals to be able to enable the service form systemd on reboot
 +
 +
mkdir -p /etc/e-smith/templates-custom/etc/systemd/system-preset/49-koozali.preset/
 +
printf "{
 +
\$customservice=''''servicename'''';
 +
\$OUT="";
 +
\$OUT .= \"enable                \$customservice.service\n\" if \${\$customservice}{'status'} eq \"enabled\";
 +
}" >> /etc/e-smith/templates-custom/etc/systemd/system-preset/49-koozali.preset/99'''servicename'''
 +
expand-template /etc/systemd/system-preset/49-koozali.preset
 +
/etc/e-smith/events/actions/systemd-default
 +
 +
====only /etc/rc.d/init.d/'''servicename''' file available====
 +
 +
cd /etc/rc.d/rc7.d
 +
ln -s ../init.d/'''servicename''' S85'''servicename'''
    
==Packages==
 
==Packages==
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,254

edits

Navigation menu