-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path08_logging.sh
61 lines (41 loc) · 1.58 KB
/
08_logging.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
# Starting
source ./install.config;
echo "Starting to set up logging directory..";
# Create Log Directory
mkdir -p $OPENXPKI_LOG_DIR;
chown -f $OPENXPKI_USR:$OPENXPKI_USR $OPENXPKI_LOG_DIR;
chmod -f 755 $OPENXPKI_LOG_DIR;
# openxpki.log
touch $OPENXPKI_LOG_DIR/openxpki.log;
chown -f $OPENXPKI_USR:root $OPENXPKI_LOG_DIR/openxpki.log;
chmod -f 600 $OPENXPKI_LOG_DIR/openxpki.log;
# scep.log
touch $OPENXPKI_LOG_DIR/scep.log;
chown -f $APACHE_USER:$APACHE_USER $OPENXPKI_LOG_DIR/scep.log;
chmod -f 644 $OPENXPKI_LOG_DIR/scep.log;
# soap.log
touch $OPENXPKI_LOG_DIR/soap.log;
chown -f $APACHE_USER:$APACHE_USER $OPENXPKI_LOG_DIR/soap.log;
chmod -f 644 $OPENXPKI_LOG_DIR/soap.log;
# webui.log
touch $OPENXPKI_LOG_DIR/webui.log;
chown -f $APACHE_USER:$APACHE_USER $OPENXPKI_LOG_DIR/webui.log;
chmod -f 644 $OPENXPKI_LOG_DIR/webui.log;
#rpc.log
touch $OPENXPKI_LOG_DIR/rpc.log;
chown -f $APACHE_USER:$APACHE_USER $OPENXPKI_LOG_DIR/rpc.log;
chmod -f 644 $OPENXPKI_LOG_DIR/rpc.log;
# SELinux
# semanage fcontext -a -t httpd_sys_script_ra_t $OPENXPKI_LOG_DIR/webui.log;
semanage fcontext -a -t httpd_sys_ra_content_t $OPENXPKI_LOG_DIR/webui.log;
restorecon $OPENXPKI_LOG_DIR/webui.log;
semanage fcontext -a -t httpd_sys_ra_content_t $OPENXPKI_LOG_DIR/rpc.log;
restorecon $OPENXPKI_LOG_DIR/rpc.log;
semanage fcontext -a -t httpd_sys_ra_content_t $OPENXPKI_LOG_DIR/scep.log;
restorecon $OPENXPKI_LOG_DIR/scep.log;
semanage fcontext -a -t httpd_sys_ra_content_t $OPENXPKI_LOG_DIR/soap.log;
restorecon $OPENXPKI_LOG_DIR/soap.log;
# Exiting
echo "Finished setting up logging directory..";
exit 0;