Skip to content

Instantly share code, notes, and snippets.

@CharlieSu
Created August 4, 2011 16:40
Show Gist options
  • Save CharlieSu/1125595 to your computer and use it in GitHub Desktop.
Save CharlieSu/1125595 to your computer and use it in GitHub Desktop.
there appears to be a way to stop daemons from being started when they are installed: apparently just create /usr/sbin/policy-rc.d with "#!/bin/sh; exit 101"
the way I read it (here's a link that's not an e-mail: http://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt) scripts usually call invoke-rc.d but if you have policy-rc.d that gets called. I'm not sure where else invoke-rc.d is called and don't know what the consequences would be
# Create a policy-rc.d to stop maintainer scripts using invoke-rc.d from
# running init scripts. In case of maintainer scripts that don't use
# invoke-rc.d, add a dummy start-stop-daemon.
disable_daemons () {
cat > /target/usr/sbin/policy-rc.d <<EOF
#!/bin/sh
exit 101
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment