Commit Graph

34 Commits

Author SHA1 Message Date
zr
97356ceab9 modify _get_pid by pidfile 2018-02-18 00:24:07 +08:00
apapp
0878dbd0e8 add -n with netstat so we don't resolve 2017-09-29 15:03:56 -04:00
rallytime
74d9a36d5a Merge branch 'nitrogen' into 'develop'
Conflicts:
  - pkg/salt-proxy@.service
  - salt/modules/npm.py
  - salt/modules/parted.py
  - tests/integration/modules/test_libcloud_dns.py
2017-06-13 15:01:51 -06:00
David Murphy
7ab3319090 Update notrim check, netstat takes minutes if large number connections - 260K 2017-06-07 10:47:06 -06:00
rongzeng
bd0f3a4359 fixed salt-minion initd file bug
if salt-minion has its grains, for using "salt-call --local config.get PARAM" get the right PARAM, should add "--skip-grains", or the script cant work normal.
2017-06-01 14:37:01 +08:00
cDR
6539dbdbca Do not use name resolving for --notrim check
This causes a significant delay on servers with many open connections
2017-03-06 09:06:20 -07:00
Mike Place
4cd698ca33 Merge pull request #39104 from githubcdr/develop
Do not use name resolving for --notrim check
2017-02-01 11:25:27 -07:00
cDR
351c039257 Do not use name resolving for --notrim check
This causes a significant delay on servers with many open connections
2017-02-01 11:02:10 +01:00
Denys Havrysh
c94e798b8a SysV init script for rpm: get and show unique PIDs only 2016-12-14 12:31:42 +02:00
Denys Havrysh
8ff68c4128 Fix initscript for RHEL5 (SysV) to pick up proper python version 2016-11-29 16:23:48 +02:00
Thayne Harbaugh
aab8e23975 Minor tweaks/improvements to the salt-minion SysV init script.
* Test "reload" before probing minion configuration
* change indent
2016-07-28 12:12:45 -06:00
plastikos
0efbbcd17f * Improve init script: specifically manage salt configurations rather than arbitrary salt processes (#32666)
* * Improve init script: specifically manage salt configurations rather than arbitrary salt processes

Unfortunately SysV init scripts tend to rummage through PIDs filtering for
appropriate processes to manage.  Unfortunately the filters are usually weak
and don't account for similar processes run by other users, PIDs of dead
processes being re-used for completely different executables, etc..  These
weaknesses can result in killing unrelated processes with potentially serious
results.

These improvements to the SysV init script is a complete rewrite with the
following improvements:

  * Specifically manage individual salt configurations rather than looking for
    salt minion-like processes.
  * Obtain salt minion information from the salt configuration - use the
    information to manage the specifically configured process.
  * Drop all of the platform-specific helper functions that allow the
    previously-mentioned weaknesses.

    + Unfortunately this means that the output information may not match the
      specific platform (this could easily be corrected).

  * Now can manage multiple salt processes started by different users

    + Unfortunately starts/stops/restarts as a group and is unable to manage
      them both as a group or as individual processes (this could easily be
      corrected)

The new initscript also allows various control variables to be overridden by
environment variables or through settings put in ``/etc/sysconf/salt`` or
``/etc/default/salt``.

:SALTMINION_DEBUG: Dump each line expansion before execution, output system
                   information on failure.  Default: unset

:SALTMINION_BINDIR: Location of ``salt-minion``, ``salt-call`` and other
                    executables.  Default: ``/usr/bin``

:SALTMINION_SYSCONFDIR: The parent directory for the ``salt`` configuration
                        directory and the ``sysconfig`` or ``default``
                        directory.

* Add lines that went missing in the rebase+squash
2016-05-09 10:57:13 -07:00
Zach Malone
d8767959d6 Removing $? after "echo" for other startup scripts 2015-10-23 09:57:53 -06:00
Bastiaan Bakker
ec8d4b0470 test wether RETVAL is 0 with -eq rather than =. 2015-08-17 17:20:33 +02:00
Bastiaan Bakker
a83a5de41e fix issue #26161: on RedHat family systems touch /var/lock/subsys/$SERVICE to ensure the daemon will be stopped on shutdown. 2015-08-17 11:11:12 +02:00
bhepple
ed3166990c Update salt-minion
On our RHEL5 systems we're getting 2 and sometimes 3 or more salt-minions started. Somehow the check on /var/run/salt-minion.pid doesn't prevent this.

This patch stops the registered process and kills any further salt-minion processes, first trying -TERM and then -KILL signals.

It may be that other distros would like to use this same logic to tidy up, in which case the new code can be moved into place as appropriate.
2014-06-25 14:58:02 +10:00
Tom Atkinson
4c87afbdc8 Fix service restart over salt 2014-02-18 20:37:53 +01:00
Nathan Rini
73a839d637 Fix bug to allow for multiple PIDs to be returned
Bug:
```
[root@pronghorn04 ~]# service salt-minion restart
Stopping salt-minion daemon:                               [  OK  ]
Starting salt-minion daemon: /etc/init.d/salt-minion: line 67: [: 22610:
unary operator expected
                                                           [  OK  ]
```

Traced bug:
```
++ pidof -c -o 21702 -o 21341 -o %PPID -x salt-minion
+ '[' 22610 7606 ']'
/etc/init.d/salt-minion: line 67: [: 22610: unary operator expected
```
2014-01-15 15:50:41 -07:00
Damian Myerscough
65cde36f94 Fix #9511 multiple PID's cause unary operator expected 2014-01-06 19:46:33 +01:00
Damian Myerscough
c6ed4980dc Fix #9511 multiple PID's cause unary operator expected 2014-01-06 19:41:34 +01:00
C. R. Oldham
8e53d5ff80 Back out earlier fix. 2013-10-31 17:04:58 -06:00
C. R. Oldham
5c58d4f245 Fix #4410, make sure that "ssh root@host -C service salt-minio restart" will return. 2013-10-25 17:20:10 -06:00
Erik Johnson
d310dcbb80 Update initscripts, spec file for 0.17.0
This also fixes an issue with sourcing of /etc/rc.d/init.d/functions in
RHEL/CentOS/Fedora/etc., allowing the use of /etc/default/salt to
override environment variables.
2013-09-30 21:09:25 -05:00
Erik Johnson
186c929c51 Fix sanity checks and defaults file sourcing 2013-09-13 12:48:50 -05:00
David Anderson
cabb8230f3 Fix https://github.com/saltstack/salt/issues/6785 2013-09-11 14:14:14 -06:00
deniskin82
39221190fe Fix in init script for RHEL/CentOS. Don't start the salt-minion if it's already running and there is no PID file 2013-05-03 16:18:42 -04:00
David Lindquist
73dc0874c2 service.start salt-minion hangs from console on CentOS
Fixes #4410
2013-04-06 14:59:28 -07:00
Clint Savage
fe22763da0 update the start / kill order with chkconfig 2013-02-13 11:17:33 -07:00
Henrik Holmboe
4fa8e63033 Fix the LSB header
I got complaints from insserv that the LSB header was not compliant. It was
missing required keywords, which must be there even if they are empty.
2013-02-13 16:32:49 +01:00
Henrik Holmboe
464ca9dd1f Allow alternative executables
With this commit it is possible to use virtualenv with the init scripts.

For example, I have this in my /etc/default/salt:

```
SALTMASTER=/srv/venvs/venv-1/bin/salt-master
SALTMINION=/srv/venvs/venv-1/bin/salt-minion
SALTSYNDIC=/srv/venvs/venv-1/bin/salt-syndic
SALTAPI=/srv/venvs/venv-1/bin/salt-api
PYTHON=/srv/venvs/venv-1/bin/python
```
2013-02-13 15:30:13 +01:00
Mike Chesnut
ce3e1ca09c changing locations of python and salt binaries to be variables in init scripts; also changing how daemon functio nis called so it uses the full path 2012-05-10 13:41:50 -07:00
Clint Savage
d45f1ad998 SysV and rpmlint clean up 2012-01-08 20:28:30 -07:00
Thomas S Hatch
0ba610a719 The spec file and init scripts build rpms that run ton f15 and SL6 2011-07-13 23:15:34 -06:00
Thomas S Hatch
5b334894c7 Add rpm stuff 2011-04-02 23:02:48 -06:00