@@ -139,6 +139,20 @@ Enable autologin on tty1 (may work only for Ubuntu 14.04): | |||
To disable set autologin to `false`. | |||
Set ``policy-rc.d`` on Debian-based systems. Action can be any available | |||
command in ``while true`` loop and ``case`` context. | |||
Following will disallow dpkg to stop/start services for cassandra package automatically: | |||
.. code-block:: yaml | |||
linux: | |||
system: | |||
policyrcd: | |||
- package: cassandra | |||
action: exit 101 | |||
- package: '*' | |||
action: switch | |||
Kernel | |||
~~~~~~ | |||
@@ -0,0 +1,10 @@ | |||
{%- from "linux/map.jinja" import system with context -%} | |||
#!/bin/sh | |||
while true; do | |||
case $1 in | |||
{%- for policy in system.policyrcd %} | |||
{{ policy.package }}) {{ policy.action }};; | |||
{%- endfor %} | |||
esac | |||
done |
@@ -51,3 +51,6 @@ include: | |||
{%- if system.motd|length > 0 %} | |||
- linux.system.motd | |||
{%- endif %} | |||
{%- if system.get('policyrcd', [])|length > 0 %} | |||
- linux.system.policyrcd | |||
{%- endif %} |
@@ -0,0 +1,19 @@ | |||
{%- from "linux/map.jinja" import system with context %} | |||
{%- if system.enabled %} | |||
policyrcd_file: | |||
file.managed: | |||
- name: /usr/local/sbin/policy-rc.d | |||
- source: salt://linux/files/policy-rc.d | |||
- mode: 655 | |||
- template: jinja | |||
policyrcd_alternatives: | |||
alternatives.install: | |||
- name: policy-rc.d | |||
- link: /usr/sbin/policy-rc.d | |||
- path: /usr/local/sbin/policy-rc.d | |||
- require: | |||
- file: policyrcd_file | |||
{%- endif %} |
@@ -64,3 +64,8 @@ linux: | |||
opencontrail: | |||
source: "deb http://ppa.launchpad.net/tcpcloud/contrail-2.20/ubuntu trusty main" | |||
architectures: amd64 | |||
policyrcd: | |||
- package: cassandra | |||
action: exit 101 | |||
- package: '*' | |||
action: switch |