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-replace-match-with-message.patch \
53 file://lighttpd-init-script-chroot.patch \
54 file://nfsserver-remvoe-the-f-option-for-rpc.mountd.patch \
55 file://nfsserver.service-add-dependency-on-rpcbind.service.patch \
67 install -m 0755 -d ${D}/${datadir}/starlingx/config-files
68 for f in $(find ./ -name '*\.spec' | cut -d '/' -f2);
70 tar -c $f -f - | tar -C ${D}/${datadir}/starlingx/config-files -xf -;
72 find ${D}/${datadir}/starlingx/config-files -name centos -exec rm -rf {} +
73 chown -R root:root ${D}/${datadir}/starlingx/config-files/
75 # For io-scheduler-config
76 mkdir -p ${D}/${sysconfdir}/udev/rules.d
77 install -m 644 ${S}/io-scheduler/centos/files/60-io-scheduler.rules ${D}/${sysconfdir}/udev/rules.d/60-io-scheduler.rules
78 rm -rf ${D}/${datadir}/starlingx/config-files/io-scheduler
82 PACKAGES += "audit-config"
83 PACKAGES += "centos-release-config"
84 PACKAGES += "dhclient-config"
85 PACKAGES += "dnsmasq-config"
86 PACKAGES += "docker-config"
87 PACKAGES += "initscripts-config"
88 PACKAGES += "filesystem-scripts"
89 PACKAGES += "haproxy-config"
90 PACKAGES += "ioscheduler-config"
91 PACKAGES += "iptables-config"
92 PACKAGES += "iscsi-initiator-utils-config"
93 PACKAGES += "lighttpd-config"
94 PACKAGES += "logrotate-config"
95 PACKAGES += "memcached-custom"
96 PACKAGES += "mlx4-config"
97 PACKAGES += "net-snmp-config"
98 PACKAGES += "nfs-utils-config"
99 PACKAGES += "ntp-config"
100 PACKAGES += "openldap-config"
101 PACKAGES += "openssh-config"
102 PACKAGES += "openvswitch-config"
103 PACKAGES += "pam-config"
104 PACKAGES += "rabbitmq-server-config"
105 PACKAGES += "rsync-config"
106 PACKAGES += "setup-config"
107 PACKAGES += "shadow-utils-config"
108 PACKAGES += "sudo-config"
109 PACKAGES += "syslog-ng-config"
110 PACKAGES += "systemd-config"
111 PACKAGES += "util-linux-config"
114 FILES_audit-config = "${datadir}/starlingx/config-files/audit-config/"
115 FILES_centos-release-config = "${datadir}/starlingx/config-files/centos-release-config/"
116 FILES_dhclient-config = "${datadir}/starlingx/config-files/dhcp-config/"
117 FILES_dnsmasq-config = "${datadir}/starlingx/config-files/dnsmasq-config/"
118 FILES_docker-config = "${datadir}/starlingx/config-files/docker-config/"
119 FILES_initscripts-config = "${datadir}/starlingx/config-files/initscripts-config/"
120 FILES_filesystem-scripts= "${datadir}/starlingx/config-files/filesystem-scripts/"
121 FILES_haproxy-config= "${datadir}/starlingx/config-files/haproxy-config/"
122 FILES_ioscheduler-config= "${sysconfdir}/udev/rules.d/60-io-scheduler.rules"
123 FILES_iptables-config= "${datadir}/starlingx/config-files/iptables-config/"
124 FILES_iscsi-initiator-utils-config = "${datadir}/starlingx/config-files/iscsi-initiator-utils-config/"
125 FILES_lighttpd-config= "${datadir}/starlingx/config-files/lighttpd-config/"
126 FILES_logrotate-config= "${datadir}/starlingx/config-files/logrotate-config/"
127 FILES_memcached-custom = "${datadir}/starlingx/config-files/memcached-custom/"
128 FILES_mlx4-config= "${datadir}/starlingx/config-files/mlx4-config/"
129 FILES_net-snmp-config= "${datadir}/starlingx/config-files/net-snmp-config/"
130 FILES_nfs-utils-config= "${datadir}/starlingx/config-files/nfs-utils-config/"
131 FILES_ntp-config= "${datadir}/starlingx/config-files/ntp-config/"
132 FILES_openldap-config= "${datadir}/starlingx/config-files/openldap-config/"
133 FILES_openssh-config= "${datadir}/starlingx/config-files/openssh-config/"
134 FILES_openvswitch-config= "${datadir}/starlingx/config-files/openvswitch-config/"
135 FILES_pam-config= "${datadir}/starlingx/config-files/pam-config/"
136 FILES_rabbitmq-server-config= "${datadir}/starlingx/config-files/rabbitmq-server-config/"
137 FILES_rsync-config= "${datadir}/starlingx/config-files/rsync-config/"
138 FILES_setup-config= "${datadir}/starlingx/config-files/setup-config/"
139 FILES_shadow-utils-config= "${datadir}/starlingx/config-files/shadow-utils-config/"
140 FILES_sudo-config= "${datadir}/starlingx/config-files/sudo-config/"
141 FILES_syslog-ng-config= "${datadir}/starlingx/config-files/syslog-ng-config/"
142 FILES_systemd-config= "${datadir}/starlingx/config-files/systemd-config/"
143 FILES_util-linux-config= "${datadir}/starlingx/config-files/util-linux-config/"
145 RDEPENDS_audit-config += " \
150 RDEPENDS_dhclient-config += "dhcp-client"
151 RDEPENDS_dnsmasq-config += "dnsmasq"
152 RDEPENDS_docker-config += "docker-ce logrotate "
153 RDEPENDS_initscripts-config += "initscripts"
154 RDEPENDS_filesystem-scripts += ""
155 RDEPENDS_haproxy-config += "haproxy"
156 RDEPENDS_ioscheduler-config += ""
157 RDEPENDS_iptables-config += "iptables"
158 RDEPENDS_iscsi-initiator-utils-config += " iscsi-initiator-utils"
159 RDEPENDS_lighttpd-config += " \
161 lighttpd-module-proxy \
162 lighttpd-module-setenv \
164 RDEPENDS_logrotate-config += " logrotate cronie"
165 RDEPENDS_memcached-custom += "memcached"
166 RDEPENDS_mlx4-config += ""
167 RDEPENDS_net-snmp-config += " \
169 net-snmp-server-snmpd \
170 net-snmp-server-snmptrapd \
172 RDEPENDS_nfs-utils-config += " nfs-utils"
173 RDEPENDS_ntp-config += " ntp"
174 RDEPENDS_openldap-config += " \
177 RRECOMMENDS_openldap-config += " \
179 openldap-backend-shell \
180 openldap-backend-passwd \
181 openldap-backend-null \
182 openldap-backend-monitor \
183 openldap-backend-meta \
184 openldap-backend-ldap \
185 openldap-backend-dnssrv \
188 openldap-overlay-proxycache \
194 RDEPENDS_openssh-config += " openssh"
195 RDEPENDS_openvswitch-config += " openvswitch"
196 RDEPENDS_pam-config += " \
201 pam-plugin-cracklib \
207 pam-plugin-faildelay \
215 pam-plugin-listfile \
216 pam-plugin-localuser \
217 pam-plugin-loginuid \
219 pam-plugin-mkhomedir \
221 pam-plugin-namespace \
224 pam-plugin-pwhistory \
227 pam-plugin-securetty \
230 pam-plugin-succeed-if \
234 pam-plugin-timestamp \
241 RDEPENDS_rabbitmq-server-config += " rabbitmq-server"
242 RDEPENDS_rsync-config += " rsync"
243 RDEPENDS_setup-config += ""
244 RDEPENDS_shadow-utils-config += " shadow"
245 RDEPENDS_sudo-config += " sudo"
246 RDEPENDS_syslog-ng-config += " syslog-ng"
247 RDEPENDS_systemd-config += " systemd"
248 RDEPENDS_util-linux-config += " util-linux"
250 pkg_postinst_ontarget_audit-config() {
251 cp -f ${datadir}/starlingx/config-files/audit-config/files/syslog.conf ${sysconfdir}/audisp/plugins.d/syslog.conf
252 chmod 640 ${sysconfdir}/audisp/plugins.d/syslog.conf
255 pkg_postinst_centos-release-config() {
256 sed 's/@PLATFORM_RELEASE@/${ORAN_REL}/' $D${datadir}/starlingx/config-files/centos-release-config/files/issue >> $D${sysconfdir}/issue
257 sed 's/@PLATFORM_RELEASE@/${ORAN_REL}/' $D${datadir}/starlingx/config-files/centos-release-config/files/issue.net >> $D${sysconfdir}/issue.net
258 chmod 644 $D${sysconfdir}/issue
259 chmod 644 $D${sysconfdir}/issue.net
262 pkg_postinst_ontarget_dhclient-config() {
263 SRCPATH=${datadir}/starlingx/config-files/dhcp-config/files
264 install -m 0755 -p ${SRCPATH}/dhclient-enter-hooks ${sysconfdir}/dhcp/dhclient-enter-hooks
265 install -m 0755 -p ${SRCPATH}/dhclient.conf ${sysconfdir}/dhcp/dhclient/dhclient.conf
266 ln -fs ${sysconfdir}/dhcp/dhclient-enter-hooks ${sysconfdir}/dhclient-enter-hooks
269 pkg_postinst_ontarget_dnsmasq-config() {
270 install -m 755 ${datadir}/starlingx/config-files/dnsmasq-config/files/init ${sysconfdir}/init.d/dnsmasq
273 pkg_postinst_ontarget_docker-config() {
274 SRCPATH=${datadir}/starlingx/config-files/docker-config/files
275 install -d -m 0755 ${sysconfdir}/systemd/system/docker.service.d
277 install -D -m 644 ${SRCPATH}/docker-pmond.conf ${sysconfdir}/pmon.d/docker.conf
278 install -D -m 644 ${SRCPATH}/docker-stx-override.conf \
279 ${sysconfdir}/systemd/system/docker.service.d/docker-stx-override.conf
280 install -D -m 644 ${SRCPATH}/docker.logrotate ${sysconfdir}/logrotate.d/docker.logrotate
283 pkg_postinst_ontarget_filesystem-scripts() {
284 SRCPATH=${datadir}/starlingx/config-files/filesystem-scripts/filesystem-scripts-1.0
285 install -D -m 755 ${SRCPATH}/uexportfs ${sysconfdir}/init.d/uexportfs
287 install -d -m 0755 /usr/lib/ocf/resource.d/platform/
288 install -D -m 755 ${SRCPATH}/nfsserver-mgmt /usr/lib/ocf/resource.d/platform/nfsserver-mgmt
290 install -p -D -m 755 ${SRCPATH}/nfs-mount ${bindir}/nfs-mount
291 install -D -m 755 ${SRCPATH}/uexportfs.service ${systemd_system_unitdir}/uexportfs.service
293 systemctl enable uexportfs.service
297 pkg_postinst_ontarget_haproxy-config() {
299 install -d -m 755 ${sysconfdir}/haproxy/errors/
300 install -m 755 ${datadir}/starlingx/config-files/haproxy-config/files/503.http ${sysconfdir}/haproxy/errors/503.http
302 install -m 644 ${datadir}/starlingx/config-files/haproxy-config/files/haproxy.service ${sysconfdir}/systemd/system/
303 install -p -D -m 0755 ${datadir}/starlingx/config-files/haproxy-config/files/haproxy.sh ${sysconfdir}/init.d/haproxy
305 /bin/systemctl disable haproxy.service
306 if test -s ${sysconfdir}/logrotate.d/haproxy ; then
307 echo '#See /etc/logrotate.d/syslog for haproxy rules' > ${sysconfdir}/logrotate.d/haproxy
311 pkg_postinst_ontarget_initscripts-config() {
312 install -d -m 755 ${sysconfdir}/sysconfig
313 install -d -m 755 ${sysconfdir}/init.d
314 install -d -m 755 ${systemd_system_unitdir}
316 SRCPATH=${datadir}/starlingx/config-files/initscripts-config/files
317 install -m 644 ${SRCPATH}/sysctl.conf ${datadir}/starlingx/stx.sysctl.conf
318 install -m 644 ${SRCPATH}/sysconfig-network.conf ${sysconfdir}/sysconfig/network
319 install -m 755 ${SRCPATH}/mountnfs.sh ${sysconfdir}/init.d/mountnfs
320 install -m 644 ${SRCPATH}/mountnfs.service ${systemd_system_unitdir}/mountnfs.service
323 cp -f ${datadir}/starlingx/stx.sysctl.conf ${sysconfdir}/sysctl.conf
324 chmod 644 ${sysconfdir}/sysctl.conf
327 pkg_postinst_ontarget_iscsi-initiator-utils-config() {
329 # package StarlingX configuration files of iscsi-initiator-utils to system folder.
331 # install -d ${libdir}/tmpfiles.d
332 # install -d ${sysconfdir}/systemd/system
333 # install -d ${datadir}/starlingx
335 SRCPATH=${datadir}/starlingx/config-files/iscsi-initiator-utils-config/files
336 tmpfilesdir=${libdir}/tmpfiles.d
338 install -m 0644 ${SRCPATH}/iscsi-cache.volatiles ${tmpfilesdir}/iscsi-cache.conf
339 install -m 0644 ${SRCPATH}/iscsi-shutdown.service ${sysconfdir}/systemd/system
340 install -m 0644 ${SRCPATH}/iscsid.conf ${datadir}/starlingx/stx.iscsid.conf
342 cp -f ${datadir}/starlingx/stx.iscsid.conf ${sysconfdir}/iscsi/iscsid.conf
343 chmod 0750 ${sysconfdir}/iscsi
344 chmod 0640 ${sysconfdir}/iscsi/iscsid.conf
346 /bin/systemctl disable iscsi-shutdown.service
349 pkg_postinst_ontarget_lighttpd-config() {
351 # StarlingX lighttpd configuration file
353 CONFDIR=${sysconfdir}/lighttpd
355 SRCPATH=${datadir}/starlingx/config-files/lighttpd-config/files
357 install -d -m 1777 ${ROOTDIR}/tmp
358 install -d ${CONFDIR}/ssl
359 install -d ${ROOTDIR}/pages/dav
360 install -m640 ${SRCPATH}/lighttpd.conf ${datadir}/starlingx/lighttpd.conf
361 install -m755 ${SRCPATH}/lighttpd.init ${datadir}/starlingx/lighttpd.init
362 install -m644 ${SRCPATH}/lighttpd-inc.conf ${CONFDIR}/lighttpd-inc.conf
363 install -m644 ${SRCPATH}/index.html.lighttpd ${ROOTDIR}/pages/index.html
365 install -d ${sysconfdir}/logrotate.d
366 install -m644 ${SRCPATH}/lighttpd.logrotate ${datadir}/starlingx/lighttpd.logrotate
367 chmod 02770 ${sysconfdir}/lighttpd
369 cp --preserve=xattr -f ${datadir}/starlingx/lighttpd.conf ${sysconfdir}/lighttpd/lighttpd.conf
370 chmod 640 ${sysconfdir}/lighttpd/lighttpd.conf
371 cp --preserve=xattr -f ${datadir}/starlingx/lighttpd.logrotate ${sysconfdir}/logrotate.d/lighttpd
372 chmod 644 ${sysconfdir}/logrotate.d/lighttpd
374 # /etc/rc.d/init.d/lighttpd is not a config file, so replace it here if it doesn't match
375 cp --preserve=xattr -f ${datadir}/starlingx/lighttpd.init ${sysconfdir}/rc.d/init.d/lighttpd
376 cp --preserve=xattr -f ${datadir}/starlingx/lighttpd.init ${sysconfdir}/init.d/lighttpd
377 chmod 755 ${sysconfdir}/rc.d/init.d/lighttpd
378 chmod 755 ${sysconfdir}/init.d/lighttpd
381 pkg_postinst_ontarget_logrotate-config() {
383 # StarlingX logrotate configuration file
385 SRCPATH=${datadir}/starlingx/config-files/logrotate-config/files
387 install -m 644 ${SRCPATH}/logrotate-cron.d ${sysconfdir}/cron.d/logrotate
388 install -m 644 ${SRCPATH}/logrotate.conf ${datadir}/starlingx/logrotate.conf
390 cp -f ${datadir}/starlingx/logrotate.conf ${sysconfdir}/logrotate.conf
391 chmod 644 ${sysconfdir}/logrotate.conf
392 mv ${sysconfdir}/cron.daily/logrotate ${sysconfdir}/logrotate.cron
393 chmod 700 ${sysconfdir}/logrotate.cron
397 pkg_postinst_ontarget_memcached-custom() {
398 # Summary: package memcached service files to system folder.
400 SRCPATH=${datadir}/starlingx/config-files/memcached-custom/files
401 install -m 644 -p ${SRCPATH}/memcached.service ${sysconfdir}/systemd/system/memcached.service
405 pkg_postinst_ontarget_mlx4-config() {
407 # Wind River Mellanox port-type configuration scripts
408 SRCPATH=${datadir}/starlingx/config-files/mlx4-config/files
410 # /bin/systemctl disable mlx4-config.service >/dev/null 2>&1
412 install -m 755 ${SRCPATH}/mlx4-configure.sh ${sysconfdir}/init.d/
413 install -m 644 ${SRCPATH}/mlx4-config.service ${systemd_system_unitdir}/
414 install -m 555 ${SRCPATH}/mlx4_core_goenabled.sh ${sysconfdir}/goenabled.d/
415 install -m 755 ${SRCPATH}/mlx4_core_config.sh ${bindir}/
417 /bin/systemctl enable mlx4-config.service >/dev/null 2>&1
421 pkg_postinst_ontarget_net-snmp-config() {
423 # package StarlingX configuration files of net-snmp to system folder.
425 SRCPATH=${datadir}/starlingx/config-files/net-snmp-config/files
427 install -d ${datadir}/snmp
429 install -m 644 ${SRCPATH}/stx.snmpd.conf ${datadir}/starlingx/stx.snmpd.conf
430 install -m 755 ${SRCPATH}/stx.snmpd ${sysconfdir}/rc.d/init.d/snmpd
431 install -m 755 ${SRCPATH}/stx.snmpd ${sysconfdir}/init.d/snmpd
432 install -m 660 ${SRCPATH}/stx.snmp.conf ${datadir}/snmp/snmp.conf
433 install -m 644 ${SRCPATH}/snmpd.service ${sysconfdir}/systemd/system/snmpd.service
436 cp -f ${datadir}/starlingx/stx.snmpd.conf ${sysconfdir}/snmp/snmpd.conf
437 chmod 640 ${sysconfdir}/snmp/snmpd.conf
438 chmod 640 ${sysconfdir}/snmp/snmptrapd.conf
440 /bin/systemctl disable snmpd.service
444 pkg_postinst_nfs-utils-config() {
446 # package customized configuration and service files of nfs-utils to system folder.
449 SRCPATH=$D${datadir}/starlingx/config-files/nfs-utils-config/files
452 install -m 755 -p -D ${SRCPATH}/nfscommon $D${sysconfdir}/init.d
453 install -m 644 -p -D ${SRCPATH}/nfscommon.service $D${systemd_system_unitdir}/
454 install -m 755 -p -D ${SRCPATH}/nfsserver $D${sysconfdir}/init.d
455 install -m 644 -p -D ${SRCPATH}/nfsserver.service $D${systemd_system_unitdir}
456 install -m 644 -p -D ${SRCPATH}/nfsmount.conf $D${datadir}/starlingx/stx.nfsmount.conf
458 cp -f $D${datadir}/starlingx/stx.nfsmount.conf $D${sysconfdir}/nfsmount.conf
459 chmod 644 $D${sysconfdir}/nfsmount.conf
461 # enable nfs services by default
467 systemctl daemon-reload
470 systemctl $OPTS enable nfscommon.service
471 systemctl $OPTS enable nfsserver.service
474 systemctl --no-block restart nfscommon.service
475 systemctl --no-block restart nfsserver.service
479 pkg_postinst_ontarget_ntp-config() {
481 # StarlingX ntp configuration file
483 SRCPATH=${datadir}/starlingx/config-files/ntp-config/files
484 install -D -m644 ${SRCPATH}/ntpd.sysconfig ${datadir}/starlingx/ntpd.sysconfig
485 install -D -m644 ${SRCPATH}/ntp.conf ${datadir}/starlingx/ntp.conf
487 cp -f ${datadir}/starlingx/ntpd.sysconfig ${sysconfdir}/sysconfig/ntpd
488 cp -f ${datadir}/starlingx/ntp.conf ${sysconfdir}/ntp.conf
489 chmod 644 ${sysconfdir}/sysconfig/ntpd
490 chmod 644 ${sysconfdir}/ntp.conf
494 pkg_postinst_ontarget_openldap-config() {
496 # StarlingX openldap configuration file
498 SRCPATH=${datadir}/starlingx/config-files/openldap-config/files
500 install -m 755 ${SRCPATH}/initscript ${sysconfdir}/init.d/openldap
501 install -m 600 ${SRCPATH}/slapd.conf ${sysconfdir}/openldap/slapd.conf
503 install -m 600 ${SRCPATH}/initial_config.ldif ${sysconfdir}/openldap/initial_config.ldif
505 install -m 644 ${SRCPATH}/slapd.service ${sysconfdir}/systemd/system/slapd.service
506 install -m 644 ${SRCPATH}/slapd.sysconfig ${datadir}/starlingx/slapd.sysconfig
508 sed -i -e 's|/var/run|/run|' ${sysconfdir}/systemd/system/slapd.service
510 cp -f ${datadir}/starlingx/slapd.sysconfig ${sysconfdir}/sysconfig/slapd
511 chmod 644 ${systemd_system_unitdir}/slapd
514 pkg_postinst_openssh-config() {
516 # package StarlingX configuration files of openssh to system folder.
519 SRCPATH=$D${datadir}/starlingx/config-files/openssh-config/files
521 install -m 644 ${SRCPATH}/sshd.service $D${sysconfdir}/systemd/system/sshd.service
522 install -m 644 ${SRCPATH}/ssh_config $D${datadir}/starlingx/ssh_config
523 install -m 600 ${SRCPATH}/sshd_config $D${datadir}/starlingx/sshd_config
525 # remove the unsupported and deprecated options
526 sed -i -e 's/^\(GSSAPIAuthentication.*\)/#\1/' \
527 -e 's/^\(GSSAPICleanupCredentials.*\)/#\1/' \
528 -e 's/^\(UsePrivilegeSeparation.*\)/#\1/' \
529 $D${datadir}/starlingx/sshd_config
531 sed -i -e 's/\(GSSAPIAuthentication yes\)/#\1/' $D${datadir}/starlingx/ssh_config
533 cp -f $D${datadir}/starlingx/ssh_config $D${sysconfdir}/ssh/ssh_config
534 cp -f $D${datadir}/starlingx/sshd_config $D${sysconfdir}/ssh/sshd_config
536 # enable sshd service by default
542 systemctl daemon-reload
545 systemctl $OPTS enable sshd.service
548 systemctl --no-block restart sshd.service
553 pkg_postinst_ontarget_openvswitch-config() {
555 # StarlingX openvswitch configuration file
557 SRCPATH=${datadir}/starlingx/config-files/openvswitch-config/files
559 install -m 0644 ${SRCPATH}/ovsdb-server.pmon.conf ${sysconfdir}/openvswitch/ovsdb-server.pmon.conf
560 install -m 0644 ${SRCPATH}/ovs-vswitchd.pmon.conf ${sysconfdir}/openvswitch/ovs-vswitchd.pmon.conf
561 install -m 0640 ${SRCPATH}/etc_logrotate.d_openvswitch ${datadir}/starlingx/etc_logrotate.d_openvswitch
563 cp -f ${datadir}/starlingx/etc_logrotate.d_openvswitch ${sysconfdir}/logrotate.d/openvswitch
564 chmod 644 ${sysconfdir}/logrotate.d/openvswitch
567 pkg_postinst_ontarget_pam-config() {
569 # package StarlingX configuration files of pam to system folder.
571 SRCPATH=${datadir}/starlingx/config-files/pam-config/files
573 install -m 644 ${SRCPATH}/sshd.pam ${datadir}/starlingx/sshd.pam
574 install -m 644 ${SRCPATH}/common-account ${sysconfdir}/pam.d/common-account
575 install -m 644 ${SRCPATH}/common-auth ${sysconfdir}/pam.d/common-auth
576 install -m 644 ${SRCPATH}/common-password ${sysconfdir}/pam.d/common-password
577 install -m 644 ${SRCPATH}/common-session ${sysconfdir}/pam.d/common-session
578 install -m 644 ${SRCPATH}/common-session-noninteractive ${sysconfdir}/pam.d/common-session-noninteractive
579 install -m 644 ${SRCPATH}/system-auth.pamd ${datadir}/starlingx/stx.system-auth
581 cp -f ${datadir}/starlingx/stx.system-auth ${sysconfdir}/pam.d/system-auth
582 cp -f ${datadir}/starlingx/sshd.pam ${sysconfdir}/pam.d/sshd
584 sed -i -e '/password .*pam_ldap.so/,/session .*revoke/ s/^$/password required pam_deny.so\n/g' \
585 ${sysconfdir}/pam.d/system-auth
588 pkg_postinst_ontarget_rabbitmq-server-config() {
590 # package StarlingX configuration files of rabbitmq-server to system folder.
592 SRCPATH=${datadir}/starlingx/config-files/rabbitmq-server-config/files
594 install -d ${libdir}/ocf/resource.d/rabbitmq
595 install -m 0755 ${SRCPATH}/rabbitmq-server.ocf ${libdir}/ocf/resource.d/rabbitmq/stx.rabbitmq-server
596 install -m 0644 ${SRCPATH}/rabbitmq-server.service.example ${sysconfdir}/systemd/system/rabbitmq-server.service
597 install -m 0644 ${SRCPATH}/rabbitmq-server.logrotate ${datadir}/starlingx/stx.rabbitmq-server.logrotate
599 sed -i -e 's/notify/simple/' ${sysconfdir}/systemd/system/rabbitmq-server.service
601 cp ${datadir}/starlingx/stx.rabbitmq-server.logrotate ${sysconfdir}/logrotate.d/rabbitmq-server
604 pkg_postinst_ontarget_rsync-config() {
606 # package StarlingX configuration files of rsync to system folder.
608 SRCPATH=${datadir}/starlingx/config-files/rsync-config/files
610 install -m 644 ${SRCPATH}/rsyncd.conf ${datadir}/starlingx/stx.rsyncd.conf
612 cp -f ${datadir}/starlingx/stx.rsyncd.conf ${sysconfdir}/rsyncd.conf
615 pkg_postinst_ontarget_setup-config() {
617 # package StarlingX configuration files of setup to system folder.
619 SRCPATH=${datadir}/starlingx/config-files/setup-config/files
621 install -m 644 ${SRCPATH}/motd ${datadir}/starlingx/stx.motd
622 install -m 644 ${SRCPATH}/prompt.sh ${sysconfdir}/profile.d/prompt.sh
623 install -m 644 ${SRCPATH}/custom.sh ${sysconfdir}/profile.d/custom.sh
625 cp -f ${datadir}/starlingx/stx.motd ${sysconfdir}/motd
626 chmod 600 ${sysconfdir}/{exports,fstab}
629 pkg_postinst_ontarget_shadow-utils-config() {
631 # StarlingX shadow-utils configuration file
633 SRCPATH=${datadir}/starlingx/config-files/shadow-utils-config/files
635 install -D -m644 ${SRCPATH}/login.defs ${datadir}/starlingx/login.defs
636 install -D -m644 ${SRCPATH}/clear_shadow_locks.service ${systemd_system_unitdir}/clear_shadow_locks.service
638 cp -f ${datadir}/starlingx/login.defs ${sysconfdir}/login.defs
639 chmod 644 ${sysconfdir}/login.defs
640 /bin/systemctl preset clear_shadow_locks.service
643 pkg_postinst_ontarget_sudo-config() {
645 # StarlingX sudo configuration file
647 SYSADMIN_P="4SuW8cnXFyxsk"
648 SRCPATH=${datadir}/starlingx/config-files/sudo-config/files
650 install -m 440 ${SRCPATH}/sysadmin.sudo ${sysconfdir}/sudoers.d/sysadmin
652 getent group sys_protected >/dev/null || groupadd -f -g 345 sys_protected
653 getent passwd sysadmin > /dev/null || \
654 useradd -m -g sys_protected -G root -d /home/sysadmin -p ${SYSADMIN_P} -s /bin/sh sysadmin 2> /dev/null || :
657 pkg_postinst_syslog-ng-config() {
659 # StarlingX syslog-ng configuration file
661 SRCPATH=$D${datadir}/starlingx/config-files/syslog-ng-config/files
663 install -D -m644 ${SRCPATH}/syslog-ng.conf $D${datadir}/starlingx/syslog-ng.conf
665 # Fix the config version to avoid warning
666 sed -i -e 's/\(@version: \).*/\1 3.19/' $D${datadir}/starlingx/syslog-ng.conf
668 # Workaround: comment out the udp source to aviod the service fail to start at boot time
669 sed -i -e 's/\(.*s_udp.*\)/#\1/' $D${datadir}/starlingx/syslog-ng.conf
671 install -D -m644 ${SRCPATH}/syslog-ng.logrotate $D${datadir}/starlingx/syslog-ng.logrotate
672 install -D -m644 ${SRCPATH}/remotelogging.conf $D${sysconfdir}/syslog-ng/remotelogging.conf
673 install -D -m700 ${SRCPATH}/fm_event_syslogger $D${sbindir}/fm_event_syslogger
674 install -D -m644 ${SRCPATH}/syslog-ng.service $D${datadir}/starlingx/syslog-ng.service
676 cp -f $D${datadir}/starlingx/syslog-ng.conf $D${sysconfdir}/syslog-ng/syslog-ng.conf
677 chmod 644 $D${sysconfdir}/syslog-ng/syslog-ng.conf
678 cp -f $D${datadir}/starlingx/syslog-ng.logrotate $D${sysconfdir}/logrotate.d/syslog
679 chmod 644 $D${sysconfdir}/logrotate.d/syslog
680 cp -f $D${datadir}/starlingx/syslog-ng.service $D${systemd_system_unitdir}/syslog-ng.service
681 chmod 644 $D${systemd_system_unitdir}/syslog-ng.service
683 # enable syslog-ng service by default
689 systemctl daemon-reload
692 systemctl $OPTS enable syslog-ng.service
695 systemctl --no-block restart syslog-ng.service
699 pkg_postinst_ontarget_systemd-config() {
701 # StarlingX systemd configuration file
703 SRCPATH=${datadir}/starlingx/config-files/systemd-config/files
705 install -m644 ${SRCPATH}/60-persistent-storage.rules ${sysconfdir}/udev/rules.d/60-persistent-storage.rules
706 install -m644 ${SRCPATH}/journald.conf ${datadir}/starlingx/journald.conf
707 install -m644 ${SRCPATH}/systemd.conf.tmpfiles.d ${sysconfdir}/tmpfiles.d/systemd.conf
708 install -m644 ${SRCPATH}/tmp.conf.tmpfiles.d ${sysconfdir}/tmpfiles.d/tmp.conf
709 install -m644 ${SRCPATH}/tmp.mount ${sysconfdir}/systemd/system/tmp.mount
711 cp -f ${datadir}/starlingx/journald.conf ${sysconfdir}/systemd/journald.conf
712 chmod 644 ${sysconfdir}/systemd/journald.conf
715 pkg_postinst_ontarget_util-linux-config() {
717 # package StarlingX configuration files of util-linux to system folder.
719 SRCPATH=${datadir}/starlingx/config-files/util-linux-config/files
721 install -m 644 ${SRCPATH}/stx.su ${datadir}/starlingx/stx.su
722 install -m 644 ${SRCPATH}/stx.login ${datadir}/starlingx/stx.login
723 install -m 644 ${SRCPATH}/stx.postlogin ${datadir}/starlingx/stx.postlogin
725 cp -f ${datadir}/starlingx/stx.su ${sysconfdir}/pam.d/su
726 cp -f ${datadir}/starlingx/stx.login ${sysconfdir}/pam.d/login
727 cp -f ${datadir}/starlingx/stx.postlogin ${sysconfdir}/pam.d/postlogin
731 pkg_postinst_ontarget_ioscheduler-config() {
733 # CGCS io scheduler configuration and tuning.
735 /bin/udevadm control --reload-rules
736 /bin/udevadm trigger --type=devices --subsystem-match=block
739 pkg_postinst_ontarget_iptables-config() {
741 # StarlingX iptables configuration file
743 SRCPATH=${datadir}/starlingx/config-files/iptables-config/files
745 install -m 600 ${SRCPATH}/iptables.rules ${datadir}/starlingx/iptables.rules
746 install -m 600 ${SRCPATH}/ip6tables.rules ${datadir}/starlingx/ip6tables.rules
748 cp -f S{datadir}/starlingx/iptables.rules ${sysconfdir}/sysconfig/iptables
749 chmod 600 ${sysconfdir}/sysconfig/iptables
750 cp -f ${datadir}/starlingx/ip6tables.rules ${sysconfdir}/sysconfig/ip6tables
751 chmod 600 ${sysconfdir}/sysconfig/ip6tables
752 /bin/systemctl enable iptables.service ip6tables.service >/dev/null 2>&1