backout 21843287/22139939/22662899/22619520/16694027 - needs more work.
authorMike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 22 Feb 2016 10:26:36 -0800
changeset 5480 c8882ac2a393
parent 5479 7146b76b602e
child 5481 5e30cd0645e7
backout 21843287/22139939/22662899/22619520/16694027 - needs more work.
components/rsyslog/Makefile
components/rsyslog/files/prof_attr
components/rsyslog/files/rsyslog
components/rsyslog/files/rsyslog.conf-solaris
components/rsyslog/files/rsyslog.xml
components/rsyslog/files/system-log
components/rsyslog/files/system-log.xml
components/rsyslog/patches/runtime-rsyslog.h.patch
components/rsyslog/rsyslog.p5m
--- a/components/rsyslog/Makefile	Fri Feb 19 22:48:29 2016 +0100
+++ b/components/rsyslog/Makefile	Mon Feb 22 10:26:36 2016 -0800
@@ -124,5 +124,4 @@
 REQUIRED_PACKAGES += library/liblogging
 REQUIRED_PACKAGES += library/zlib
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/core-os
 REQUIRED_PACKAGES += system/library
--- a/components/rsyslog/files/prof_attr	Fri Feb 19 22:48:29 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-Maintenance and Repair:RO:::auths=solaris.admin.edit/etc/rsyslog.conf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/rsyslog/files/rsyslog	Mon Feb 22 10:26:36 2016 -0800
@@ -0,0 +1,74 @@
+#!/usr/sbin/sh
+#
+
+#
+# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+. /lib/svc/share/smf_include.sh
+
+SVC_FMRI=svc:/system/system-log
+DEFAULT_FMRI=${SVC_FMRI}:default
+OLD_METHOD1="kill -HUP \`cat /var/run/syslog.pid\`"
+OLD_METHOD2="kill -HUP \`cat /system/volatile/syslog.pid\`"
+NEW_METHOD="/usr/sbin/svccfg -s $SVC_FMRI refresh"
+LOGADM_CONF=/etc/logadm.conf
+
+if [ ! -f /etc/rsyslog.conf ]; then
+	echo "/etc/rsyslog.conf not found. Exiting."
+	exit $SMF_EXIT_ERR_CONFIG
+fi
+
+if [ ! -f /usr/lib/rsyslog/rsyslogd ]; then
+	echo "/usr/lib/rsyslog/rsyslogd not found. Exiting."
+	exit $SMF_EXIT_ERR_CONFIG
+fi
+
+if [ ! -x /usr/lib/rsyslog/rsyslogd ]; then
+	echo "/usr/lib/rsyslog/rsyslogd not executable. Exiting."
+	exit $SMF_EXIT_ERR_CONFIG
+fi
+
+default=$(/usr/bin/svcprop -c -p general/enabled $DEFAULT_FMRI)
+if [ $default = true ]; then
+	echo "$DEFAULT_FMRI conflicts with this instance and must be disabled first. Exiting."
+	exit $SMF_EXIT_ERR_CONFIG
+fi
+
+if smf_is_globalzone; then
+	#
+	# Before [r]syslogd starts, save any messages from
+	# previous crash dumps so that messages appear
+	# in chronological order.
+	#
+        # Need to be root to use savecore
+	/usr/bin/savecore -m
+	if [ -r /etc/dumpadm.conf ]; then
+		. /etc/dumpadm.conf
+		[ -n "$DUMPADM_DEVICE" -a \
+		"$DUMPADM_DEVICE" != swap ] && \
+		/usr/bin/savecore -m -f $DUMPADM_DEVICE
+	fi
+fi
+if [ ! -f /var/adm/messages ]; then
+	/usr/bin/cp /dev/null /var/adm/messages
+	/usr/bin/chmod 0644 /var/adm/messages
+fi
+
+# Convert the old PID-file based post-command for logadm to an SMF-based one.
+TMP_CONF=$(/usr/bin/mktemp /tmp/logadm.conf.XXXXXX)
+/usr/bin/sed -e "s|$OLD_METHOD1|$NEW_METHOD|" \
+    -e "s|$OLD_METHOD2|$NEW_METHOD|" $LOGADM_CONF > $TMP_CONF
+/usr/bin/cmp -s $LOGADM_CONF $TMP_CONF
+if [ $? -eq 0 ]; then
+	/usr/bin/rm $TMP_CONF
+else
+	# In case the umask or group is odd.
+	mode=$(/usr/bin/stat -c %a $LOGADM_CONF)
+	owner_group=$(/usr/bin/stat -c %U:%G $LOGADM_CONF)
+	/usr/bin/mv $TMP_CONF $LOGADM_CONF
+	/usr/bin/chmod $mode $LOGADM_CONF
+	/usr/bin/chown $owner_group $LOGADM_CONF
+fi
+
+/usr/lib/rsyslog/rsyslogd >/dev/msglog 2>&1
--- a/components/rsyslog/files/rsyslog.conf-solaris	Fri Feb 19 22:48:29 2016 +0100
+++ b/components/rsyslog/files/rsyslog.conf-solaris	Mon Feb 22 10:26:36 2016 -0800
@@ -12,8 +12,7 @@
 $IncludeConfig /etc/rsyslog.d/
 
 # High priority messages to the console
-*.err;auth.notice				/dev/sysmsg
-
+*.err;kern.notice;auth.notice			/dev/sysmsg
 # Next highest priority to the messages file
 *.err;kern.debug;daemon.notice;mail.crit	/var/adm/messages
 
@@ -24,10 +23,9 @@
 # Log anything (except auth, cron, daemon & mail) of level info or higher.
 *.info;mail.none;auth.none;cron.none		-/var/log/misc.log
 
-# Log all the auth, daemon, kern & mail messages in one place.
+# Log all the auth, daemon & mail messages in one place.
 auth.*						-/var/log/auth.log
 daemon.*					-/var/log/daemon.log
-kern.*						-/var/log/kern.log
 mail.*						-/var/log/mail.log
 
 # Everybody gets emergency messages
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/rsyslog/files/rsyslog.xml	Mon Feb 22 10:26:36 2016 -0800
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<!--
+
+   
+    Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+
+    NOTE:  This service manifest is not editable; its contents will
+    be overwritten by package or patch operations, including
+    operating system upgrade.  Make customizations in a different
+    file.
+-->
+
+<service_bundle type='manifest' name='system/rsyslog:rsyslog'>
+
+<service
+	name='system/system-log'
+	type='service'
+	version='1'>
+
+	<instance name='rsyslog' enabled='false'>
+
+		<exec_method
+			type='method'
+			name='start'
+			exec='/lib/svc/method/rsyslog'
+			timeout_seconds='600'>
+			<method_context>
+			<method_credential
+			  user='root' group='root'
+			  privileges='basic,net_privaddr' />
+			</method_context>
+		</exec_method>
+
+		<template>
+			<common_name>
+				<loctext xml:lang='C'>
+				reliable and extended system log daemon
+				</loctext>
+			</common_name>
+			<documentation>
+				<manpage title='rsyslogd' section='8'
+				    manpath='/usr/share/man' />
+			</documentation>
+		</template>
+
+	</instance>
+
+</service>
+
+</service_bundle>
--- a/components/rsyslog/files/system-log	Fri Feb 19 22:48:29 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#!/usr/sbin/sh
-#
-
-#
-# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
-#
-
-. /lib/svc/share/smf_include.sh
-
-SVC_FMRI=svc:/system/system-log
-DEFAULT_FMRI=${SVC_FMRI}:default
-OLD_METHOD1="kill -HUP \`cat /var/run/syslog.pid\`"
-OLD_METHOD2="kill -HUP \`cat /system/volatile/syslog.pid\`"
-NEW_METHOD="/usr/sbin/svccfg -s $SVC_FMRI refresh"
-LOGADM_CONF=/etc/logadm.conf
-
-if [ ! -f /etc/rsyslog.conf ]; then
-	echo "/etc/rsyslog.conf not found. Exiting."
-	exit $SMF_EXIT_ERR_CONFIG
-fi
-
-if [ ! -f /usr/lib/rsyslog/rsyslogd ]; then
-	echo "/usr/lib/rsyslog/rsyslogd not found. Exiting."
-	exit $SMF_EXIT_ERR_CONFIG
-fi
-
-if [ ! -x /usr/lib/rsyslog/rsyslogd ]; then
-	echo "/usr/lib/rsyslog/rsyslogd not executable. Exiting."
-	exit $SMF_EXIT_ERR_CONFIG
-fi
-
-if smf_is_globalzone; then
-	#
-	# Before [r]syslogd starts, save any messages from
-	# previous crash dumps so that messages appear
-	# in chronological order.
-	#
-        # Need to be root to use savecore
-	/usr/bin/savecore -m
-	if [ -r /etc/dumpadm.conf ]; then
-		. /etc/dumpadm.conf
-		[ -n "$DUMPADM_DEVICE" -a \
-		"$DUMPADM_DEVICE" != swap ] && \
-		/usr/bin/savecore -m -f $DUMPADM_DEVICE
-	fi
-fi
-if [ ! -f /var/adm/messages ]; then
-	/usr/bin/cp /dev/null /var/adm/messages
-	/usr/bin/chmod 0644 /var/adm/messages
-fi
-
-# Convert the old PID-file based post-command for logadm to an SMF-based one.
-TMP_CONF=$(/usr/bin/mktemp /tmp/logadm.conf.XXXXXX)
-/usr/bin/sed -e "s|$OLD_METHOD1|$NEW_METHOD|" \
-    -e "s|$OLD_METHOD2|$NEW_METHOD|" $LOGADM_CONF > $TMP_CONF
-/usr/bin/cmp -s $LOGADM_CONF $TMP_CONF
-if [ $? -eq 0 ]; then
-	/usr/bin/rm $TMP_CONF
-else
-	# In case the umask or group is odd.
-	mode=$(/usr/bin/stat -c %a $LOGADM_CONF)
-	owner_group=$(/usr/bin/stat -c %U:%G $LOGADM_CONF)
-	/usr/bin/mv $TMP_CONF $LOGADM_CONF
-	/usr/bin/chmod $mode $LOGADM_CONF
-	/usr/bin/chown $owner_group $LOGADM_CONF
-fi
-
-/usr/lib/rsyslog/rsyslogd >/dev/msglog 2>&1
--- a/components/rsyslog/files/system-log.xml	Fri Feb 19 22:48:29 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
-<!--
-   
-    Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
-
-    NOTE:  This service manifest is not editable; its contents will
-    be overwritten by package or patch operations, including
-    operating system upgrade.  Make customizations in a different
-    file.
--->
-
-<service_bundle type='manifest' name='system/rsyslog:rsyslog'>
-
-<service
-	name='system/system-log'
-	type='service'
-	version='1'>
-
-	<create_default_instance enabled='false' />
-
-	<single_instance/>
-
-	<!--
-	  Ensure system is configured before starting.
-	-->
-	<dependency
-		name='milestone'
-		grouping='require_all'
-		restart_on='none'
-		type='service'>
-		<service_fmri value='svc:/milestone/self-assembly-complete' />
-	</dependency>
-
-	<!--
-	  rsyslogd(8) can log to non-root local directories.
-	-->
-	<dependency
-		name='filesystem'
-		grouping='require_all'
-		restart_on='none'
-		type='service'>
-		<service_fmri value='svc:/system/filesystem/local' />
-	</dependency>
-
-	<!--
-	  rsyslogd(8) can log to automounted files.
-	-->
-	<dependency
-		name='autofs'
-		grouping='optional_all'
-		restart_on='none'
-		type='service'>
-		<service_fmri value='svc:/system/filesystem/autofs' />
-	</dependency>
-
-	<!--
-	  rsyslogd(8) needs nameservice resolution to log to remote hosts.
-	-->
-	<dependency
-		name='name-services'
-		grouping='require_all'
-		restart_on='none'
-		type='service'>
-		<service_fmri value='svc:/milestone/name-services' />
-	</dependency>
-
-	<dependent
-		name='system-log_single-user'
-		grouping='optional_all'
-		restart_on='none'>
-		<service_fmri value='svc:/milestone/multi-user' />
-	</dependent>
-
-	<!--
-		The system-log start method includes a "savecore -m" which
-		extracts messages from dump device, needing some time to
-		perform the I/O.
-		Use an appropriately long timeout value.
-	-->
-	<exec_method
-		type='method'
-		name='start'
-		exec='/lib/svc/method/system-log'
-		timeout_seconds='600'>
-		<method_context>
-		<method_credential
-		  user='root' group='root'
-		  privileges='basic,net_privaddr,proc_setid' />
-		</method_context>
-	</exec_method>
-
-	<exec_method
-		type='method'
-		name='stop'
-		exec=':kill'
-		timeout_seconds='60' />
-
-	<exec_method
-		type='method'
-		name='refresh'
-		exec=':kill'
-		timeout_seconds='60' />
-
-	<property_group name='general' type='framework'>
-		<!-- to start stop rsyslog daemon -->
-		<propval name='action_authorization' type='astring'
-			value='solaris.smf.manage.system-log' />
-		<propval name='value_authorization' type='astring'
-			value='solaris.smf.manage.system-log' />
-	</property_group>
-
-	<property_group name='config' type='application'>
-		<!-- default property settings for rsyslogd(8) -->
-
-		<!-- Specifies whether remote messages are logged.
-		     log_from_remote=false is equivalent to the -t
-		     command-line option. log_from_remote=true
-		     is equivalent to the -T command-line option.
-		-->
-		<propval
-			name='log_from_remote'
-			type='boolean'
-			value='false' />
-
-		<!-- authorization to modify the configuration properties -->
-		<propval name='value_authorization' type='astring'
-			value='solaris.smf.value.system-log' />
-	</property_group>
-
-	<property_group name='firewall_context' type='com.sun,fw_definition'>
-		<propval name='name' type='astring' value='rsyslog' />
-	</property_group>
-
-	<property_group name='firewall_config' type='com.sun,fw_configuration'>
-		<propval name='policy' type='astring' value='use_global' />
-		<propval name='apply_to' type='astring' value='' />
-		<propval name='exceptions' type='astring' value='' />
-		<propval name='value_authorization' type='astring'
-			value='solaris.smf.value.firewall.config' />
-	</property_group>
-
-	<stability value='Unstable' />
-
-	<template>
-		<common_name>
-			<loctext xml:lang='C'>
-			reliable and extended system log daemon
-			</loctext>
-		</common_name>
-		<documentation>
-			<manpage title='rsyslogd' section='8'
-				manpath='/usr/share/man' />
-		</documentation>
-	</template>
-</service>
-
-</service_bundle>
--- a/components/rsyslog/patches/runtime-rsyslog.h.patch	Fri Feb 19 22:48:29 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-Solaris specific patch to add syslog compatibility.
-Not for community.
-
-
---- rsyslog-8.4.2/runtime/rsyslog.h_orig	2015-11-18 14:24:33.132132227 -0800
-+++ rsyslog-8.4.2/runtime/rsyslog.h	2015-11-18 14:27:39.523227382 -0800
-@@ -106,6 +106,8 @@
- #define	LOG_CRON	(9<<3)	/* clock daemon */
- #define	LOG_AUTHPRIV	(10<<3)	/* security/authorization messages (private) */
- #define	LOG_FTP		(11<<3)	/* ftp daemon */
-+#define	LOG_AUDIT	(13<<3)	/* rfc5424 */
-+#define	LOG_CRON2	(15<<3)	/* rfc5424 */
- #define	LOG_LOCAL0	(16<<3)	/* reserved for local use */
- #define	LOG_LOCAL1	(17<<3)	/* reserved for local use */
- #define	LOG_LOCAL2	(18<<3)	/* reserved for local use */
--- a/components/rsyslog/rsyslog.p5m	Fri Feb 19 22:48:29 2016 +0100
+++ b/components/rsyslog/rsyslog.p5m	Mon Feb 22 10:26:36 2016 -0800
@@ -45,10 +45,8 @@
 file rsyslog.conf-solaris path=etc/rsyslog.conf owner=root group=sys mode=0644 \
     overlay=allow preserve=true
 dir  path=etc/rsyslog.d
-file prof_attr path=etc/security/prof_attr.d/system:rsyslog
-file system-log.xml path=lib/svc/manifest/system/system-log.xml \
-    restart_fmri=svc:/system/system-log:default
-file system-log path=lib/svc/method/system-log
+file rsyslog.xml path=lib/svc/manifest/system/rsyslog.xml
+file rsyslog path=lib/svc/method/rsyslog
 file path=usr/lib/rsyslog/imgssapi.so
 file path=usr/lib/rsyslog/immark.so
 file path=usr/lib/rsyslog/imsolaris.so