Commit Graph

25 Commits

Author SHA1 Message Date
Benedikt Heine a71c105335 Run shellcheck over initscripts
Mainly quoting all variables
2020-12-27 16:57:23 +01:00
Benedikt Heine ebb2ec7e92 Use tabs for indentation
Except for the switch case, the script was written with tab indentation.
With tabstop of 4 spaces, the indentation in the switch case would make
sense, but I assume this is just a glitch of the editor.
2020-12-27 16:34:02 +01:00
Benedikt Heine d4251ea5ca Exit from script instead of subshell on missing user
When executing `false || (echo bad; exit 1)`, the call to `exit` won't
exit the script, it will only exit the subshell and the exit code will
be stored in the return code `$?`.

Since this is an error, we have to exit the script properly.
2020-12-27 16:29:37 +01:00
Sascha Westermann a761adad8a Fix System-V return codes according to LSB
- "status"-calls use different exit codes, refer to http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html
- the "status"-call in "condrestart" returned an error if the daemon was not running: this has been fixed
2019-05-14 11:22:05 +02:00
Markus Frosch 9fbc40615a Improve path handling in cmake and daemon 2018-08-07 14:10:26 +02:00
Jean Flach 383ca5011c Load functions first
refs #6449
2018-07-18 13:36:37 +02:00
Jean Flach 2b5ea38217 Fix sysconfig not bein handled correctly by sysvinit 2018-06-15 17:04:28 +02:00
Jean Flach ed4e008e79 Rework sysconfig file
The sysconfig file now only contains the defaults as comments, changes
made there are given to the init.d script, prepare-dirs, safe-reload and
Icinga 2 itself. If nothing is set in the sysconfig file (as is the
default as all lines are commented out) the defaults are used.

fixes #6255
2018-05-23 15:18:42 +02:00
Jean Flach 6ae376b7fd Add cli tool to send signals as Icinga user
fixes #5991
2018-02-20 14:16:43 +01:00
Jean Flach ba41d7f249 Get ICINGA2_USER and GROUP from sysconfig 2018-02-20 14:16:43 +01:00
Michael Friedrich 8842aa9b0c Add network requirement to init script
fixes #4921
2017-03-30 18:47:04 +02:00
Berthold Cogel 47726d7701 Init script: condrestart should only restart a running service
fixes #11650

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-08-08 17:55:11 +02:00
Gunnar Beutner bd7b2f30ef Validate configuration files during reload
fixes #7045
2014-12-11 09:27:31 +01:00
Gunnar Beutner 7ee0eef562 Move the icinga2-prepare-dirs script to /usr/lib
fixes #7786
2014-11-27 14:47:51 +01:00
Gunnar Beutner 9f0e0aac86 Fix the init script
refs #7613
2014-11-26 08:16:13 +01:00
Michael Friedrich 9818477a44 Make sure that user/group exists when starting Icinga 2
fixes #7173
fixes #7613
2014-11-25 18:44:25 +01:00
Gunnar Beutner 6e17eadf8f Remove {DAEMON,ICINGA2}_USER and {DAEMON,ICINGA2}_GROUP variables
refs #7370
2014-10-20 21:41:04 +02:00
Gunnar Beutner a01fb6d6e6 Make sure we're using the right user/group for CLI commands
refs #7246
2014-10-13 13:44:45 +02:00
Gunnar Beutner a4081f1445 Implement support for CLI commands
fixes #7246
2014-10-08 15:33:10 +02:00
Gunnar Beutner 5ae1f4273c Init script: Check whether the PID file exists
fixes #7047
2014-09-02 13:48:48 +02:00
Gunnar Beutner dde00a3f16 Use LSB-compliant exit codes for the init script
fixes #7044
2014-09-02 13:40:33 +02:00
Gerd von Egidy fe62fb90e6 Don't call check_run in the initscript, this function is gone.
Refs #4794
2014-06-15 20:08:45 +02:00
Gerd von Egidy dd9b7bcd73 Move the sysdefines.conf file to /etc/sysconfig.
As /etc/sysconfig is distro specific, the filename used can be configured via the CMake parameter
ICINGA2_SYSCONFIGFILE

Refs #4794
2014-06-15 19:47:27 +02:00
Gerd von Egidy 4ebde46520 Move code preparing dirs and permissions to icinga2-prepare-dirs, use this for SysV-Init and systemd.
Refs #4794

Conflicts:
	etc/initsystem/icinga2.init.d.cmake
2014-06-15 16:25:50 +02:00
Gerd von Egidy ef49658474 Unify resources for SysV-Init and systemd.
- Move system-specific defines like paths and usernames to /etc/icinga2/sysdefines.conf
  Do not use /etc/sysconfig for this as per suggestion on the systemd mailinglist: it is RedHat-specific
- Use /etc/icinga2/sysdefines.conf in SysV-Init and systemd
- Move both the sources of the SysV-Initscript and the systemd-service definition to etc/initsystem

Refs #4794

Conflicts:
	etc/initsystem/icinga2.init.d.cmake
2014-06-15 15:49:13 +02:00