• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/audit/S01auditd
Maxime HadjinlianMaxime Hadjinlian committed 0f75b2635ee03 Oct 2015
Raw file
Source viewDiff to previous
 
1
#!/bin/sh
2
#
3
# auditd       This starts and stops auditd
4
#
5
# description: This starts the Linux Auditing System Daemon,
6
#              which collects security related events in a dedicated
7
#              audit log. If this daemon is turned off, audit events
8
#              will be sent to syslog.
9
#
10
​
11
NAME=auditd
12
DAEMON=/usr/sbin/${NAME}
13
CONFIG=/etc/audit/auditd.conf
14
PIDFILE=/var/run/${NAME}.pid
15
​
16
start(){
17
    printf "Starting ${NAME}: "
18
​
19
    # Create dir to store log files in if one doesn't exist. Create
20
    # the directory with SELinux permissions if possible
21
    command -v matchpathcon >/dev/null 2>&1
22
    if [ $? = 0 ]; then
23
        mkdir -p /var/log/audit -Z `matchpathcon -n /var/log/audit`
24
    else
25
        mkdir -p /var/log/audit
26
    fi
27
​
28
    # Run audit daemon executable
29
    start-stop-daemon -S -q -p ${PIDFILE} --exec ${DAEMON}
30
​
31
    if [ $? = 0 ]; then
32
        # Load the default rules
33
        test -f /etc/audit/rules.d/audit.rules && /usr/sbin/auditctl -R /etc/audit/rules.d/audit.rules >/dev/null
34
        echo "OK"
35
    else
36
        echo "FAIL"
37
    fi
38
}
39
​
40
stop(){
41
    printf "Stopping ${NAME}: "
42
​
43
    start-stop-daemon -K -q -p ${PIDFILE}
44
    [ $? = 0 ] && echo "OK" || echo "FAIL"
45
}
46
​
47
reload(){
48
    printf "Reloading ${NAME} configuration: "
49
    start-stop-daemon --stop -s 1 -p ${PIDFILE} 1>/dev/null
50
    [ $? = 0 ] && echo "OK" || echo "FAIL"
51
}
52
​
53
rotate(){
54
    printf "Rotating ${NAME} logs: "
55
    start-stop-daemon --stop -s 10 -p ${PIDFILE} 1>/dev/null
56
    [ $? = 0 ] && echo "OK" || echo "FAIL"
57
}
58
​
59
case "$1" in
60
    start)
61
        start
62
        ;;
63
    stop)
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.