PHP 8.5.2
Preview: apparmor Size: 3.65 KB
//etc/init.d/apparmor

#!/bin/sh
# ----------------------------------------------------------------------
#    Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
#     NOVELL (All rights reserved)
#    Copyright (c) 2008, 2009 Canonical, Ltd.
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of version 2 of the GNU General Public
#    License published by the Free Software Foundation.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, contact Novell, Inc.
# ----------------------------------------------------------------------
# Authors:
#  Steve Beattie <steve.beattie@canonical.com>
#  Kees Cook <kees@ubuntu.com>
#
# /etc/init.d/apparmor
#
# Note: "Required-Start: $local_fs" implies that the cache may not be available
# yet when /var is on a remote filesystem. The worst consequence this should
# have is slowing down the boot.
#
### BEGIN INIT INFO
# Provides: apparmor
# Required-Start: $local_fs
# Required-Stop: umountfs
# Default-Start: S
# Default-Stop:
# Short-Description: AppArmor initialization
# Description: AppArmor init script. This script loads all AppArmor profiles.
### END INIT INFO

APPARMOR_FUNCTIONS=/lib/apparmor/rc.apparmor.functions

# Functions needed by rc.apparmor.functions

. /lib/lsb/init-functions

aa_action() {
	STRING=$1
	shift
	$*
	rc=$?
	if [ $rc -eq 0 ] ; then
		aa_log_success_msg $"$STRING "
	else
		aa_log_failure_msg $"$STRING "
	fi
	return $rc
}

aa_log_action_start() {
	log_action_begin_msg $@
}

aa_log_action_end() {
	log_action_end_msg $@
}

aa_log_success_msg() {
	log_success_msg $@
}

aa_log_warning_msg() {
	log_warning_msg $@
}

aa_log_failure_msg() {
	log_failure_msg $@
}

aa_log_skipped_msg() {
	if [ -n "$1" ]; then
		log_warning_msg "${1}: Skipped."
	fi
}

aa_log_daemon_msg() {
	log_daemon_msg $@
}

aa_log_end_msg() {
	log_end_msg $@
}

# Source AppArmor function library
if [ -f "${APPARMOR_FUNCTIONS}" ]; then
	. ${APPARMOR_FUNCTIONS}
else
	aa_log_failure_msg "Unable to find AppArmor initscript functions"
	exit 1
fi

usage() {
    echo "Usage: $0 {start|stop|restart|reload|force-reload|status}"
}

test -x ${PARSER} || exit 0 # by debian policy
# LSM is built-in, so it is either there or not enabled for this boot
test -d /sys/module/apparmor || exit 0

# do not perform start/stop/reload actions when running from liveCD
test -d /rofs/etc/apparmor.d && exit 0

rc=255
case "$1" in
	start)
		if [ -x /usr/bin/systemd-detect-virt ] && \
		   systemd-detect-virt --quiet --container && \
		   ! is_container_with_internal_policy; then
			aa_log_daemon_msg "Not starting AppArmor in container"
			aa_log_end_msg 0
			exit 0
		fi
		apparmor_start
		rc=$?
		;;
	restart|reload|force-reload)
		if [ -x /usr/bin/systemd-detect-virt ] && \
		   systemd-detect-virt --quiet --container && \
		   ! is_container_with_internal_policy; then
			aa_log_daemon_msg "Not starting AppArmor in container"
			aa_log_end_msg 0
			exit 0
		fi
		apparmor_restart
		rc=$?
		;;
	stop)
		aa_log_daemon_msg "Leaving AppArmor profiles loaded"
		cat >&2 <<EOM
No profiles have been unloaded.

Unloading profiles will leave already running processes permanently
unconfined, which can lead to unexpected situations.

To set a process to complain mode, use the command line tool
'aa-complain'. To really tear down all profiles, run 'aa-teardown'."
EOM
		;;
	status)
		apparmor_status
		rc=$?
		;;
	*)
		usage
		rc=1
		;;
	esac
exit $rc

Directory Contents

Dirs: 0 × Files: 45

Name Size Perms Modified Actions
3.65 KB lrwxr-xr-x 2025-08-15 12:16:02
Edit Download
2.22 KB lrwxr-xr-x 2025-07-08 14:50:50
Edit Download
1.85 KB lrwxr-xr-x 2023-11-14 20:02:33
Edit Download
1.21 KB lrwxr-xr-x 2024-02-26 12:58:31
Edit Download
3.03 KB lrwxr-xr-x 2024-02-27 02:22:50
Edit Download
937 B lrwxr-xr-x 2024-06-05 13:46:49
Edit Download
896 B lrwxr-xr-x 2024-06-05 13:46:49
Edit Download
3.08 KB lrwxr-xr-x 2023-12-05 15:36:45
Edit Download
2.15 KB lrwxr-xr-x 2016-10-23 23:10:58
Edit Download
6.85 KB lrwxr-xr-x 2024-06-10 21:27:45
Edit Download
985 B lrwxr-xr-x 2025-03-17 11:36:12
Edit Download
1.48 KB lrwxr-xr-x 2025-02-11 08:52:16
Edit Download
1.45 KB lrwxr-xr-x 2024-02-26 12:58:31
Edit Download
2.00 KB lrwxr-xr-x 2024-04-18 10:06:53
Edit Download
3.40 KB lrwxr-xr-x 2024-04-01 06:55:32
Edit Download
6.27 KB lrwxr-xr-x 2025-12-04 10:46:13
Edit Download
4.47 KB lrwxr-xr-x 2025-04-28 07:08:08
Edit Download
2.41 KB lrwxr-xr-x 2025-02-11 08:52:16
Edit Download
1.80 KB lrwxr-xr-x 2025-09-05 13:01:22
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-12-30 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-12-30 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2026-01-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2026-01-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2026-01-22 07:08:08
Edit Download
1.35 KB lrwxr-xr-x 2024-03-21 13:42:02
Edit Download
760 B lrwxr-xr-x 2024-03-21 13:42:02
Edit Download
3.02 KB lrwxr-xr-x 2024-03-05 15:20:59
Edit Download
959 B lrwxr-xr-x 2024-03-24 15:35:54
Edit Download
5.20 KB lrwxr-xr-x 2024-05-09 07:08:08
Edit Download
3.04 KB lrwxr-xr-x 2025-07-30 19:03:47
Edit Download
1.57 KB lrwxr-xr-x 2024-01-09 13:42:30
Edit Download
4.31 KB lrwxr-xr-x 2024-04-12 17:09:41
Edit Download
1.19 KB lrwxr-xr-x 2021-02-18 08:51:15
Edit Download
3.96 KB lrwxr-xr-x 2025-07-21 15:58:50
Edit Download
1.54 KB lrwxr-xr-x 2024-01-09 20:31:44
Edit Download
2.04 KB lrwxr-xr-x 2024-02-11 13:20:32
Edit Download
1.36 KB lrwxr-xr-x 2024-02-12 17:50:35
Edit Download
1.28 KB lrwxr-xr-x 2024-04-09 14:02:37
Edit Download
4.46 KB lrwxr-xr-x 2023-11-25 12:25:37
Edit Download
2.70 KB lrwxr-xr-x 2021-10-19 09:04:11
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).