2 ## Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 DESCRIPTION = "stx-config-files"
20 SRCREV = "d778e862571957ece3c404c0c37d325769772fde"
21 SRCNAME = "config-files"
25 LICENSE = "Apache-2.0"
27 file://systemd-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
28 file://audit-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
29 file://docker-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
30 file://filesystem-scripts/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
31 file://filesystem-scripts/filesystem-scripts-1.0/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
32 file://io-scheduler/centos/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
33 file://iptables-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
34 file://lighttpd-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
35 file://logrotate-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
36 file://mlx4-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
37 file://ntp-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
38 file://openldap-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
39 file://openvswitch-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
40 file://shadow-utils-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
41 file://sudo-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
42 file://syslog-ng-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
43 file://systemd-config/files/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
47 git://opendev.org/starlingx/${SRCNAME}.git;protocol=${PROTOCOL};rev=${SRCREV};branch=${BRANCH} \
48 file://openssh-config-rm-hmac-ripemd160.patch \
49 file://util-linux-pam-postlogin.patch \
50 file://syslog-ng-config-parse-err.patch \
51 file://syslog-ng-config-systemd-service.patch \
52 file://syslog-ng-conf-fix-the-source.patch \
53 file://syslog-ng-conf-replace-match-with-message.patch \
54 file://lighttpd-init-script-chroot.patch \
66 install -m 0755 -d ${D}/${datadir}/starlingx/config-files
67 for f in $(find ./ -name '*\.spec' | cut -d '/' -f2);
69 tar -c $f -f - | tar -C ${D}/${datadir}/starlingx/config-files -xf -;
71 find ${D}/${datadir}/starlingx/config-files -name centos -exec rm -rf {} +
72 chown -R root:root ${D}/${datadir}/starlingx/config-files/
74 # For io-scheduler-config
75 mkdir -p ${D}/${sysconfdir}/udev/rules.d
76 install -m 644 ${S}/io-scheduler/centos/files/60-io-scheduler.rules ${D}/${sysconfdir}/udev/rules.d/60-io-scheduler.rules
77 rm -rf ${D}/${datadir}/starlingx/config-files/io-scheduler
81 PACKAGES += "audit-config"
82 PACKAGES += "centos-release-config"
83 PACKAGES += "dhclient-config"
84 PACKAGES += "dnsmasq-config"
85 PACKAGES += "docker-config"
86 PACKAGES += "initscripts-config"
87 PACKAGES += "filesystem-scripts"
88 PACKAGES += "haproxy-config"
89 PACKAGES += "ioscheduler-config"
90 PACKAGES += "iptables-config"
91 PACKAGES += "iscsi-initiator-utils-config"
92 PACKAGES += "lighttpd-config"
93 PACKAGES += "logrotate-config"
94 PACKAGES += "memcached-custom"
95 PACKAGES += "mlx4-config"
96 PACKAGES += "net-snmp-config"
97 PACKAGES += "nfs-utils-config"
98 PACKAGES += "ntp-config"
99 PACKAGES += "openldap-config"
100 PACKAGES += "openssh-config"
101 PACKAGES += "openvswitch-config"
102 PACKAGES += "pam-config"
103 PACKAGES += "rabbitmq-server-config"
104 PACKAGES += "rsync-config"
105 PACKAGES += "setup-config"
106 PACKAGES += "shadow-utils-config"
107 PACKAGES += "sudo-config"
108 PACKAGES += "syslog-ng-config"
109 PACKAGES += "systemd-config"
110 PACKAGES += "util-linux-config"
113 FILES_audit-config = "${datadir}/starlingx/config-files/audit-config/"
114 FILES_centos-release-config = "${datadir}/starlingx/config-files/centos-release-config/"
115 FILES_dhclient-config = "${datadir}/starlingx/config-files/dhcp-config/"
116 FILES_dnsmasq-config = "${datadir}/starlingx/config-files/dnsmasq-config/"
117 FILES_docker-config = "${datadir}/starlingx/config-files/docker-config/"
118 FILES_initscripts-config = "${datadir}/starlingx/config-files/initscripts-config/"
119 FILES_filesystem-scripts= "${datadir}/starlingx/config-files/filesystem-scripts/"
120 FILES_haproxy-config= "${datadir}/starlingx/config-files/haproxy-config/"
121 FILES_ioscheduler-config= "${sysconfdir}/udev/rules.d/60-io-scheduler.rules"
122 FILES_iptables-config= "${datadir}/starlingx/config-files/iptables-config/"
123 FILES_iscsi-initiator-utils-config = "${datadir}/starlingx/config-files/iscsi-initiator-utils-config/"
124 FILES_lighttpd-config= "${datadir}/starlingx/config-files/lighttpd-config/"
125 FILES_logrotate-config= "${datadir}/starlingx/config-files/logrotate-config/"
126 FILES_memcached-custom = "${datadir}/starlingx/config-files/memcached-custom/"
127 FILES_mlx4-config= "${datadir}/starlingx/config-files/mlx4-config/"
128 FILES_net-snmp-config= "${datadir}/starlingx/config-files/net-snmp-config/"
129 FILES_nfs-utils-config= "${datadir}/starlingx/config-files/nfs-utils-config/"
130 FILES_ntp-config= "${datadir}/starlingx/config-files/ntp-config/"
131 FILES_openldap-config= "${datadir}/starlingx/config-files/openldap-config/"
132 FILES_openssh-config= "${datadir}/starlingx/config-files/openssh-config/"
133 FILES_openvswitch-config= "${datadir}/starlingx/config-files/openvswitch-config/"
134 FILES_pam-config= "${datadir}/starlingx/config-files/pam-config/"
135 FILES_rabbitmq-server-config= "${datadir}/starlingx/config-files/rabbitmq-server-config/"
136 FILES_rsync-config= "${datadir}/starlingx/config-files/rsync-config/"
137 FILES_setup-config= "${datadir}/starlingx/config-files/setup-config/"
138 FILES_shadow-utils-config= "${datadir}/starlingx/config-files/shadow-utils-config/"
139 FILES_sudo-config= "${datadir}/starlingx/config-files/sudo-config/"
140 FILES_syslog-ng-config= "${datadir}/starlingx/config-files/syslog-ng-config/"
141 FILES_systemd-config= "${datadir}/starlingx/config-files/systemd-config/"
142 FILES_util-linux-config= "${datadir}/starlingx/config-files/util-linux-config/"
144 RDEPENDS_audit-config += " \
149 RDEPENDS_dhclient-config += "dhcp-client"
150 RDEPENDS_dnsmasq-config += ""
151 RDEPENDS_docker-config += "docker-ce logrotate "
152 RDEPENDS_initscripts-config += "initscripts"
153 RDEPENDS_filesystem-scripts += ""
154 RDEPENDS_haproxy-config += "haproxy"
155 RDEPENDS_ioscheduler-config += ""
156 RDEPENDS_iptables-config += "iptables"
157 RDEPENDS_iscsi-initiator-utils-config += " iscsi-initiator-utils"
158 RDEPENDS_lighttpd-config += " \
160 lighttpd-module-proxy \
161 lighttpd-module-setenv \
163 RDEPENDS_logrotate-config += " logrotate cronie"
164 RDEPENDS_memcached-custom += "memcached"
165 RDEPENDS_mlx4-config += ""
166 RDEPENDS_net-snmp-config += " \
168 net-snmp-server-snmpd \
169 net-snmp-server-snmptrapd \
171 RDEPENDS_nfs-utils-config += " nfs-utils"
172 RDEPENDS_ntp-config += " ntp"
173 RDEPENDS_openldap-config += " \
176 RRECOMMENDS_openldap-config += " \
178 openldap-backend-shell \
179 openldap-backend-passwd \
180 openldap-backend-null \
181 openldap-backend-monitor \
182 openldap-backend-meta \
183 openldap-backend-ldap \
184 openldap-backend-dnssrv \
187 openldap-overlay-proxycache \
193 RDEPENDS_openssh-config += " openssh"
194 RDEPENDS_openvswitch-config += " openvswitch"
195 RDEPENDS_pam-config += " \
200 pam-plugin-cracklib \
206 pam-plugin-faildelay \
214 pam-plugin-listfile \
215 pam-plugin-localuser \
216 pam-plugin-loginuid \
218 pam-plugin-mkhomedir \
220 pam-plugin-namespace \
223 pam-plugin-pwhistory \
226 pam-plugin-securetty \
229 pam-plugin-succeed-if \
233 pam-plugin-timestamp \
240 RDEPENDS_rabbitmq-server-config += " rabbitmq-server"
241 RDEPENDS_rsync-config += " rsync"
242 RDEPENDS_setup-config += ""
243 RDEPENDS_shadow-utils-config += " shadow"
244 RDEPENDS_sudo-config += " sudo"
245 RDEPENDS_syslog-ng-config += " syslog-ng"
246 RDEPENDS_systemd-config += " systemd"
247 RDEPENDS_util-linux-config += " util-linux"
249 pkg_postinst_ontarget_audit-config() {
250 cp -f ${datadir}/starlingx/config-files/audit-config/files/syslog.conf ${sysconfdir}/audisp/plugins.d/syslog.conf
251 chmod 640 ${sysconfdir}/audisp/plugins.d/syslog.conf
254 pkg_postinst_centos-release-config() {
255 sed 's/@PLATFORM_RELEASE@/${STX_REL}/' $D${datadir}/starlingx/config-files/centos-release-config/files/issue >> $D${sysconfdir}/issue
256 sed 's/@PLATFORM_RELEASE@/${STX_REL}/' $D${datadir}/starlingx/config-files/centos-release-config/files/issue.net >> $D${sysconfdir}/issue.net
257 chmod 644 $D${sysconfdir}/issue
258 chmod 644 $D${sysconfdir}/issue.net
261 pkg_postinst_ontarget_dhclient-config() {
262 SRCPATH=${datadir}/starlingx/config-files/dhcp-config/files
263 install -m 0755 -p ${SRCPATH}/dhclient-enter-hooks ${sysconfdir}/dhcp/dhclient-enter-hooks
264 install -m 0755 -p ${SRCPATH}/dhclient.conf ${sysconfdir}/dhcp/dhclient/dhclient.conf
265 ln -fs ${sysconfdir}/dhcp/dhclient-enter-hooks ${sysconfdir}/dhclient-enter-hooks
268 pkg_postinst_ontarget_dnsmasq-config() {
269 install -m 755 ${datadir}/starlingx/config-files/dnsmasq-config/files/init ${sysconfdir}/init.d/dnsmasq
272 pkg_postinst_ontarget_docker-config() {
273 SRCPATH=${datadir}/starlingx/config-files/docker-config/files
274 install -d -m 0755 ${sysconfdir}/systemd/system/docker.service.d
276 install -D -m 644 ${SRCPATH}/docker-pmond.conf ${sysconfdir}/pmon.d/docker.conf
277 install -D -m 644 ${SRCPATH}/docker-stx-override.conf \
278 ${sysconfdir}/systemd/system/docker.service.d/docker-stx-override.conf
279 install -D -m 644 ${SRCPATH}/docker.logrotate ${sysconfdir}/logrotate.d/docker.logrotate
282 pkg_postinst_ontarget_filesystem-scripts() {
283 SRCPATH=${datadir}/starlingx/config-files/filesystem-scripts/filesystem-scripts-1.0
284 install -D -m 755 ${SRCPATH}/uexportfs ${sysconfdir}/init.d/uexportfs
286 install -d -m 0755 /usr/lib/ocf/resource.d/platform/
287 install -D -m 755 ${SRCPATH}/nfsserver-mgmt /usr/lib/ocf/resource.d/platform/nfsserver-mgmt
289 install -p -D -m 755 ${SRCPATH}/nfs-mount ${bindir}/nfs-mount
290 install -D -m 755 ${SRCPATH}/uexportfs.service ${systemd_system_unitdir}/uexportfs.service
292 systemctl enable uexportfs.service
296 pkg_postinst_ontarget_haproxy-config() {
298 install -d -m 755 ${sysconfdir}/haproxy/errors/
299 install -m 755 ${datadir}/starlingx/config-files/haproxy-config/files/503.http ${sysconfdir}/haproxy/errors/503.http
301 install -m 644 ${datadir}/starlingx/config-files/haproxy-config/files/haproxy.service ${sysconfdir}/systemd/system/
302 install -p -D -m 0755 ${datadir}/starlingx/config-files/haproxy-config/files/haproxy.sh ${sysconfdir}/init.d/haproxy
304 /bin/systemctl disable haproxy.service
305 if test -s ${sysconfdir}/logrotate.d/haproxy ; then
306 echo '#See /etc/logrotate.d/syslog for haproxy rules' > ${sysconfdir}/logrotate.d/haproxy
310 pkg_postinst_ontarget_initscripts-config() {
311 install -d -m 755 ${sysconfdir}/sysconfig
312 install -d -m 755 ${sysconfdir}/init.d
313 install -d -m 755 ${systemd_system_unitdir}
315 SRCPATH=${datadir}/starlingx/config-files/initscripts-config/files
316 install -m 644 ${SRCPATH}/sysctl.conf ${datadir}/starlingx/stx.sysctl.conf
317 install -m 644 ${SRCPATH}/sysconfig-network.conf ${sysconfdir}/sysconfig/network
318 install -m 755 ${SRCPATH}/mountnfs.sh ${sysconfdir}/init.d/mountnfs
319 install -m 644 ${SRCPATH}/mountnfs.service ${systemd_system_unitdir}/mountnfs.service
322 cp -f ${datadir}/starlingx/stx.sysctl.conf ${sysconfdir}/sysctl.conf
323 chmod 644 ${sysconfdir}/sysctl.conf
326 pkg_postinst_ontarget_iscsi-initiator-utils-config() {
328 # package StarlingX configuration files of iscsi-initiator-utils to system folder.
330 # install -d ${libdir}/tmpfiles.d
331 # install -d ${sysconfdir}/systemd/system
332 # install -d ${datadir}/starlingx
334 SRCPATH=${datadir}/starlingx/config-files/iscsi-initiator-utils-config/files
335 tmpfilesdir=${libdir}/tmpfiles.d
337 install -m 0644 ${SRCPATH}/iscsi-cache.volatiles ${tmpfilesdir}/iscsi-cache.conf
338 install -m 0644 ${SRCPATH}/iscsi-shutdown.service ${sysconfdir}/systemd/system
339 install -m 0644 ${SRCPATH}/iscsid.conf ${datadir}/starlingx/stx.iscsid.conf
341 cp -f ${datadir}/starlingx/stx.iscsid.conf ${sysconfdir}/iscsi/iscsid.conf
342 chmod 0750 ${sysconfdir}/iscsi
343 chmod 0640 ${sysconfdir}/iscsi/iscsid.conf
345 /bin/systemctl disable iscsi-shutdown.service
348 pkg_postinst_ontarget_lighttpd-config() {
350 # StarlingX lighttpd configuration file
352 CONFDIR=${sysconfdir}/lighttpd
354 SRCPATH=${datadir}/starlingx/config-files/lighttpd-config/files
356 install -d -m 1777 ${ROOTDIR}/tmp
357 install -d ${CONFDIR}/ssl
358 install -d ${ROOTDIR}/pages/dav
359 install -m640 ${SRCPATH}/lighttpd.conf ${datadir}/starlingx/lighttpd.conf
360 install -m755 ${SRCPATH}/lighttpd.init ${datadir}/starlingx/lighttpd.init
361 install -m644 ${SRCPATH}/lighttpd-inc.conf ${CONFDIR}/lighttpd-inc.conf
362 install -m644 ${SRCPATH}/index.html.lighttpd ${ROOTDIR}/pages/index.html
364 install -d ${sysconfdir}/logrotate.d
365 install -m644 ${SRCPATH}/lighttpd.logrotate ${datadir}/starlingx/lighttpd.logrotate
366 chmod 02770 ${sysconfdir}/lighttpd
368 cp --preserve=xattr -f ${datadir}/starlingx/lighttpd.conf ${sysconfdir}/lighttpd/lighttpd.conf
369 chmod 640 ${sysconfdir}/lighttpd/lighttpd.conf
370 cp --preserve=xattr -f ${datadir}/starlingx/lighttpd.logrotate ${sysconfdir}/logrotate.d/lighttpd
371 chmod 644 ${sysconfdir}/logrotate.d/lighttpd
373 # /etc/rc.d/init.d/lighttpd is not a config file, so replace it here if it doesn't match
374 cp --preserve=xattr -f ${datadir}/starlingx/lighttpd.init ${sysconfdir}/rc.d/init.d/lighttpd
375 cp --preserve=xattr -f ${datadir}/starlingx/lighttpd.init ${sysconfdir}/init.d/lighttpd
376 chmod 755 ${sysconfdir}/rc.d/init.d/lighttpd
377 chmod 755 ${sysconfdir}/init.d/lighttpd
380 pkg_postinst_ontarget_logrotate-config() {
382 # StarlingX logrotate configuration file
384 SRCPATH=${datadir}/starlingx/config-files/logrotate-config/files
386 install -m 644 ${SRCPATH}/logrotate-cron.d ${sysconfdir}/cron.d/logrotate
387 install -m 644 ${SRCPATH}/logrotate.conf ${datadir}/starlingx/logrotate.conf
389 cp -f ${datadir}/starlingx/logrotate.conf ${sysconfdir}/logrotate.conf
390 chmod 644 ${sysconfdir}/logrotate.conf
391 mv ${sysconfdir}/cron.daily/logrotate ${sysconfdir}/logrotate.cron
392 chmod 700 ${sysconfdir}/logrotate.cron
396 pkg_postinst_ontarget_memcached-custom() {
397 # Summary: package memcached service files to system folder.
399 SRCPATH=${datadir}/starlingx/config-files/memcached-custom/files
400 install -m 644 -p ${SRCPATH}/memcached.service ${sysconfdir}/systemd/system/memcached.service
404 pkg_postinst_ontarget_mlx4-config() {
406 # Wind River Mellanox port-type configuration scripts
407 SRCPATH=${datadir}/starlingx/config-files/mlx4-config/files
409 # /bin/systemctl disable mlx4-config.service >/dev/null 2>&1
411 install -m 755 ${SRCPATH}/mlx4-configure.sh ${sysconfdir}/init.d/
412 install -m 644 ${SRCPATH}/mlx4-config.service ${systemd_system_unitdir}/
413 install -m 555 ${SRCPATH}/mlx4_core_goenabled.sh ${sysconfdir}/goenabled.d/
414 install -m 755 ${SRCPATH}/mlx4_core_config.sh ${bindir}/
416 /bin/systemctl enable mlx4-config.service >/dev/null 2>&1
420 pkg_postinst_ontarget_net-snmp-config() {
422 # package StarlingX configuration files of net-snmp to system folder.
424 SRCPATH=${datadir}/starlingx/config-files/net-snmp-config/files
426 install -d ${datadir}/snmp
428 install -m 644 ${SRCPATH}/stx.snmpd.conf ${datadir}/starlingx/stx.snmpd.conf
429 install -m 755 ${SRCPATH}/stx.snmpd ${sysconfdir}/rc.d/init.d/snmpd
430 install -m 755 ${SRCPATH}/stx.snmpd ${sysconfdir}/init.d/snmpd
431 install -m 660 ${SRCPATH}/stx.snmp.conf ${datadir}/snmp/snmp.conf
432 install -m 644 ${SRCPATH}/snmpd.service ${sysconfdir}/systemd/system/snmpd.service
435 cp -f ${datadir}/starlingx/stx.snmpd.conf ${sysconfdir}/snmp/snmpd.conf
436 chmod 640 ${sysconfdir}/snmp/snmpd.conf
437 chmod 640 ${sysconfdir}/snmp/snmptrapd.conf
439 /bin/systemctl disable snmpd.service
443 pkg_postinst_ontarget_nfs-utils-config() {
445 # package customized configuration and service files of nfs-utils to system folder.
448 SRCPATH=${datadir}/starlingx/config-files/nfs-utils-config/files
451 install -m 755 -p -D ${SRCPATH}/nfscommon ${sysconfdir}/init.d
452 install -m 644 -p -D ${SRCPATH}/nfscommon.service ${systemd_system_unitdir}/
453 install -m 755 -p -D ${SRCPATH}/nfsserver ${sysconfdir}/init.d
454 install -m 644 -p -D ${SRCPATH}/nfsserver.service ${systemd_system_unitdir}
455 install -m 644 -p -D ${SRCPATH}/nfsmount.conf ${datadir}/starlingx/stx.nfsmount.conf
457 cp -f ${datadir}/starlingx/stx.nfsmount.conf ${sysconfdir}/nfsmount.conf
458 chmod 644 ${sysconfdir}/nfsmount.conf
460 # STX - disable these service files as rpc-statd is started by nfscommon
461 /bin/systemctl disable rpc-statd.service
462 /bin/systemctl disable rpc-statd-notify.service
463 /bin/systemctl disable nfs-lock.service
464 /bin/systemctl disable nfslock.service
466 /bin/systemctl enable nfscommon.service >/dev/null 2>&1 || :
467 /bin/systemctl enable nfsserver.service >/dev/null 2>&1 || :
469 # For now skiping the preun rule
470 #/bin/systemctl disable nfscommon.service >/dev/null 2>&1 || :
471 #/bin/systemctl disable nfsserver.service >/dev/null 2>&1 || :
475 pkg_postinst_ontarget_ntp-config() {
477 # StarlingX ntp configuration file
479 SRCPATH=${datadir}/starlingx/config-files/ntp-config/files
480 install -D -m644 ${SRCPATH}/ntpd.sysconfig ${datadir}/starlingx/ntpd.sysconfig
481 install -D -m644 ${SRCPATH}/ntp.conf ${datadir}/starlingx/ntp.conf
483 cp -f ${datadir}/starlingx/ntpd.sysconfig ${sysconfdir}/sysconfig/ntpd
484 cp -f ${datadir}/starlingx/ntp.conf ${sysconfdir}/ntp.conf
485 chmod 644 ${sysconfdir}/sysconfig/ntpd
486 chmod 644 ${sysconfdir}/ntp.conf
490 pkg_postinst_ontarget_openldap-config() {
492 # StarlingX openldap configuration file
494 SRCPATH=${datadir}/starlingx/config-files/openldap-config/files
496 install -m 755 ${SRCPATH}/initscript ${sysconfdir}/init.d/openldap
497 install -m 600 ${SRCPATH}/slapd.conf ${sysconfdir}/openldap/slapd.conf
499 install -m 600 ${SRCPATH}/initial_config.ldif ${sysconfdir}/openldap/initial_config.ldif
501 install -m 644 ${SRCPATH}/slapd.service ${sysconfdir}/systemd/system/slapd.service
502 install -m 644 ${SRCPATH}/slapd.sysconfig ${datadir}/starlingx/slapd.sysconfig
504 sed -i -e 's|/var/run|/run|' ${sysconfdir}/systemd/system/slapd.service
506 cp -f ${datadir}/starlingx/slapd.sysconfig ${sysconfdir}/sysconfig/slapd
507 chmod 644 ${systemd_system_unitdir}/slapd
510 pkg_postinst_openssh-config() {
512 # package StarlingX configuration files of openssh to system folder.
515 SRCPATH=$D${datadir}/starlingx/config-files/openssh-config/files
517 install -m 644 ${SRCPATH}/sshd.service $D${sysconfdir}/systemd/system/sshd.service
518 install -m 644 ${SRCPATH}/ssh_config $D${datadir}/starlingx/ssh_config
519 install -m 600 ${SRCPATH}/sshd_config $D${datadir}/starlingx/sshd_config
521 # remove the unsupported and deprecated options
522 sed -i -e 's/^\(GSSAPIAuthentication.*\)/#\1/' \
523 -e 's/^\(GSSAPICleanupCredentials.*\)/#\1/' \
524 -e 's/^\(UsePrivilegeSeparation.*\)/#\1/' \
525 $D${datadir}/starlingx/sshd_config
527 sed -i -e 's/\(GSSAPIAuthentication yes\)/#\1/' $D${datadir}/starlingx/ssh_config
529 cp -f $D${datadir}/starlingx/ssh_config $D${sysconfdir}/ssh/ssh_config
530 cp -f $D${datadir}/starlingx/sshd_config $D${sysconfdir}/ssh/sshd_config
532 # enable syslog-ng service by default
538 systemctl daemon-reload
541 systemctl $OPTS enable sshd.service
544 systemctl --no-block restart sshd.service
549 pkg_postinst_ontarget_openvswitch-config() {
551 # StarlingX openvswitch configuration file
553 SRCPATH=${datadir}/starlingx/config-files/openvswitch-config/files
555 install -m 0644 ${SRCPATH}/ovsdb-server.pmon.conf ${sysconfdir}/openvswitch/ovsdb-server.pmon.conf
556 install -m 0644 ${SRCPATH}/ovs-vswitchd.pmon.conf ${sysconfdir}/openvswitch/ovs-vswitchd.pmon.conf
557 install -m 0640 ${SRCPATH}/etc_logrotate.d_openvswitch ${datadir}/starlingx/etc_logrotate.d_openvswitch
559 cp -f ${datadir}/starlingx/etc_logrotate.d_openvswitch ${sysconfdir}/logrotate.d/openvswitch
560 chmod 644 ${sysconfdir}/logrotate.d/openvswitch
563 pkg_postinst_ontarget_pam-config() {
565 # package StarlingX configuration files of pam to system folder.
567 SRCPATH=${datadir}/starlingx/config-files/pam-config/files
569 install -m 644 ${SRCPATH}/sshd.pam ${datadir}/starlingx/sshd.pam
570 install -m 644 ${SRCPATH}/common-account ${sysconfdir}/pam.d/common-account
571 install -m 644 ${SRCPATH}/common-auth ${sysconfdir}/pam.d/common-auth
572 install -m 644 ${SRCPATH}/common-password ${sysconfdir}/pam.d/common-password
573 install -m 644 ${SRCPATH}/common-session ${sysconfdir}/pam.d/common-session
574 install -m 644 ${SRCPATH}/common-session-noninteractive ${sysconfdir}/pam.d/common-session-noninteractive
575 install -m 644 ${SRCPATH}/system-auth.pamd ${datadir}/starlingx/stx.system-auth
577 cp -f ${datadir}/starlingx/stx.system-auth ${sysconfdir}/pam.d/system-auth
578 cp -f ${datadir}/starlingx/sshd.pam ${sysconfdir}/pam.d/sshd
581 pkg_postinst_ontarget_rabbitmq-server-config() {
583 # package StarlingX configuration files of rabbitmq-server to system folder.
585 SRCPATH=${datadir}/starlingx/config-files/rabbitmq-server-config/files
587 install -d ${libdir}/ocf/resource.d/rabbitmq
588 install -m 0755 ${SRCPATH}/rabbitmq-server.ocf ${libdir}/ocf/resource.d/rabbitmq/stx.rabbitmq-server
589 install -m 0644 ${SRCPATH}/rabbitmq-server.service.example ${sysconfdir}/systemd/system/rabbitmq-server.service
590 install -m 0644 ${SRCPATH}/rabbitmq-server.logrotate ${datadir}/starlingx/stx.rabbitmq-server.logrotate
592 sed -i -e 's/notify/simple/' ${sysconfdir}/systemd/system/rabbitmq-server.service
594 cp ${datadir}/starlingx/stx.rabbitmq-server.logrotate ${sysconfdir}/logrotate.d/rabbitmq-server
597 pkg_postinst_ontarget_rsync-config() {
599 # package StarlingX configuration files of rsync to system folder.
601 SRCPATH=${datadir}/starlingx/config-files/rsync-config/files
603 install -m 644 ${SRCPATH}/rsyncd.conf ${datadir}/starlingx/stx.rsyncd.conf
605 cp -f ${datadir}/starlingx/stx.rsyncd.conf ${sysconfdir}/rsyncd.conf
608 pkg_postinst_ontarget_setup-config() {
610 # package StarlingX configuration files of setup to system folder.
612 SRCPATH=${datadir}/starlingx/config-files/setup-config/files
614 install -m 644 ${SRCPATH}/motd ${datadir}/starlingx/stx.motd
615 install -m 644 ${SRCPATH}/prompt.sh ${sysconfdir}/profile.d/prompt.sh
616 install -m 644 ${SRCPATH}/custom.sh ${sysconfdir}/profile.d/custom.sh
618 cp -f ${datadir}/starlingx/stx.motd ${sysconfdir}/motd
619 chmod 600 ${sysconfdir}/{exports,fstab}
622 pkg_postinst_ontarget_shadow-utils-config() {
624 # StarlingX shadow-utils configuration file
626 SRCPATH=${datadir}/starlingx/config-files/shadow-utils-config/files
628 install -D -m644 ${SRCPATH}/login.defs ${datadir}/starlingx/login.defs
629 install -D -m644 ${SRCPATH}/clear_shadow_locks.service ${systemd_system_unitdir}/clear_shadow_locks.service
631 cp -f ${datadir}/starlingx/login.defs ${sysconfdir}/login.defs
632 chmod 644 ${sysconfdir}/login.defs
633 /bin/systemctl preset clear_shadow_locks.service
636 pkg_postinst_ontarget_sudo-config() {
638 # StarlingX sudo configuration file
640 SYSADMIN_P="4SuW8cnXFyxsk"
641 SRCPATH=${datadir}/starlingx/config-files/sudo-config/files
643 install -m 440 ${SRCPATH}/sysadmin.sudo ${sysconfdir}/sudoers.d/sysadmin
645 getent group sys_protected >/dev/null || groupadd -f -g 345 sys_protected
646 getent passwd sysadmin > /dev/null || \
647 useradd -m -g sys_protected -G root -d /home/sysadmin -p ${SYSADMIN_P} -s /bin/sh sysadmin 2> /dev/null || :
650 pkg_postinst_syslog-ng-config() {
652 # StarlingX syslog-ng configuration file
654 SRCPATH=$D${datadir}/starlingx/config-files/syslog-ng-config/files
656 install -D -m644 ${SRCPATH}/syslog-ng.conf $D${datadir}/starlingx/syslog-ng.conf
658 # Fix the config version to avoid warning
659 sed -i -e 's/\(@version: \).*/\1 3.19/' $D${datadir}/starlingx/syslog-ng.conf
661 # Workaround: comment out the udp source to aviod the service fail to start at boot time
662 sed -i -e 's/\(.*s_udp.*\)/#\1/' $D${datadir}/starlingx/syslog-ng.conf
664 install -D -m644 ${SRCPATH}/syslog-ng.logrotate $D${datadir}/starlingx/syslog-ng.logrotate
665 install -D -m644 ${SRCPATH}/remotelogging.conf $D${sysconfdir}/syslog-ng/remotelogging.conf
666 install -D -m700 ${SRCPATH}/fm_event_syslogger $D${sbindir}/fm_event_syslogger
667 install -D -m644 ${SRCPATH}/syslog-ng.service $D${datadir}/starlingx/syslog-ng.service
669 cp -f $D${datadir}/starlingx/syslog-ng.conf $D${sysconfdir}/syslog-ng/syslog-ng.conf
670 chmod 644 $D${sysconfdir}/syslog-ng/syslog-ng.conf
671 cp -f $D${datadir}/starlingx/syslog-ng.logrotate $D${sysconfdir}/logrotate.d/syslog
672 chmod 644 $D${sysconfdir}/logrotate.d/syslog
673 cp -f $D${datadir}/starlingx/syslog-ng.service $D${systemd_system_unitdir}/syslog-ng.service
674 chmod 644 $D${systemd_system_unitdir}/syslog-ng.service
676 # enable syslog-ng service by default
682 systemctl daemon-reload
685 systemctl $OPTS enable syslog-ng.service
688 systemctl --no-block restart syslog-ng.service
693 # %systemd_preun syslog-ng.service
696 # %systemd_postun_with_restart syslog-ng.service
697 # systemctl daemon-reload 2>&1 || :
698 # systemctl try-restart
701 pkg_postinst_ontarget_systemd-config() {
703 # StarlingX systemd configuration file
705 SRCPATH=${datadir}/starlingx/config-files/systemd-config/files
707 install -m644 ${SRCPATH}/60-persistent-storage.rules ${sysconfdir}/udev/rules.d/60-persistent-storage.rules
708 install -m644 ${SRCPATH}/journald.conf ${datadir}/starlingx/journald.conf
709 install -m644 ${SRCPATH}/systemd.conf.tmpfiles.d ${sysconfdir}/tmpfiles.d/systemd.conf
710 install -m644 ${SRCPATH}/tmp.conf.tmpfiles.d ${sysconfdir}/tmpfiles.d/tmp.conf
711 install -m644 ${SRCPATH}/tmp.mount ${sysconfdir}/systemd/system/tmp.mount
713 cp -f ${datadir}/starlingx/journald.conf ${sysconfdir}/systemd/journald.conf
714 chmod 644 ${sysconfdir}/systemd/journald.conf
717 pkg_postinst_ontarget_util-linux-config() {
719 # package StarlingX configuration files of util-linux to system folder.
721 SRCPATH=${datadir}/starlingx/config-files/util-linux-config/files
723 install -m 644 ${SRCPATH}/stx.su ${datadir}/starlingx/stx.su
724 install -m 644 ${SRCPATH}/stx.login ${datadir}/starlingx/stx.login
725 install -m 644 ${SRCPATH}/stx.postlogin ${datadir}/starlingx/stx.postlogin
727 cp -f ${datadir}/starlingx/stx.su ${sysconfdir}/pam.d/su
728 cp -f ${datadir}/starlingx/stx.login ${sysconfdir}/pam.d/login
729 cp -f ${datadir}/starlingx/stx.postlogin ${sysconfdir}/pam.d/postlogin
733 pkg_postinst_ontarget_ioscheduler-config() {
735 # CGCS io scheduler configuration and tuning.
737 /bin/udevadm control --reload-rules
738 /bin/udevadm trigger --type=devices --subsystem-match=block
741 pkg_postinst_ontarget_iptables-config() {
743 # StarlingX iptables configuration file
745 SRCPATH=${datadir}/starlingx/config-files/iptables-config/files
747 install -m 600 ${SRCPATH}/iptables.rules ${datadir}/starlingx/iptables.rules
748 install -m 600 ${SRCPATH}/ip6tables.rules ${datadir}/starlingx/ip6tables.rules
750 cp -f S{datadir}/starlingx/iptables.rules ${sysconfdir}/sysconfig/iptables
751 chmod 600 ${sysconfdir}/sysconfig/iptables
752 cp -f ${datadir}/starlingx/ip6tables.rules ${sysconfdir}/sysconfig/ip6tables
753 chmod 600 ${sysconfdir}/sysconfig/ip6tables
754 /bin/systemctl enable iptables.service ip6tables.service >/dev/null 2>&1