--- rpms/smeserver-cacti/contribs10/smeserver-cacti-1.1.19-sme10.patch 2022/07/27 20:32:07 1.8 +++ rpms/smeserver-cacti/contribs10/smeserver-cacti-1.1.19-sme10.patch 2022/07/28 03:28:23 1.13 @@ -9,7 +9,7 @@ diff -Nur --no-dereference smeserver-cac )) { templates2events("/etc/cacti/db.php", $event); -@@ -22,3 +23,32 @@ +@@ -22,3 +23,35 @@ } templates2events("/etc/e-smith/sql/init/80cacti", "post-upgrade"); @@ -19,6 +19,7 @@ diff -Nur --no-dereference smeserver-cac + /etc/cacti/db.php + /etc/httpd/conf/httpd.conf + /etc/crontab ++ /etc/my.cnf + /etc/opt/remi/php74/php-fpm.d/www.conf + /etc/e-smith/sql/init/80cacti +)); @@ -26,12 +27,14 @@ diff -Nur --no-dereference smeserver-cac +event_services($event, + 'crond' => 'restart', + 'mysql.init' => 'restart', ++ 'mariadb' => 'restart', + 'httpd-e-smith' => 'sigusr1', + 'php74-php-fpm' => 'reload-or-restart' +); + +event_actions($event, -+'cacti-conf' => '50', ++'cacti-conf' => '2', ++'cacti-install' => '94', +'cacti-ldap' => '95' +); + @@ -136,7 +139,7 @@ diff -Nur --no-dereference smeserver-cac +#/sbin/e-smith/config getprop php74 MemoryLimit 1>/dev/null || ( config setprop php74 MemoryLimit 800M ; echo "setting php74 memory_limit 800M" ; psomething=1) +# install detect cli for php not php74 even if $php_path is set + -+[ $something == 1 ] && /usr/sbin/e-smith/expand-template /etc/my.cnf && /usr/bin/systemctl restart mariadb.service ++#[ $something == 1 ] && /sbin/e-smith/expand-template /etc/my.cnf +#[ $psomething == 1 ] && /usr/sbin/e-smith/expand-template /etc/opt/remi/php74/php.ini && /usr/bin/systemctl restart php74-php-fpm.service diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-ldap --- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap 1969-12-31 19:00:00.000000000 -0500 @@ -564,3 +567,75 @@ diff -Nur --no-dereference smeserver-cac +UID="root" GID="www" PERMS=0640 +diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/my.cnf/020cacti smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/my.cnf/020cacti +--- smeserver-cacti-1.1.19.old/root/etc/e-smith/templates/etc/my.cnf/020cacti 1969-12-31 19:00:00.000000000 -0500 ++++ smeserver-cacti-1.1.19/root/etc/e-smith/templates/etc/my.cnf/020cacti 2022-07-27 17:18:19.452000000 -0400 +@@ -0,0 +1,4 @@ ++#for cacti use ++innodb_buffer_pool_size=483M ++innodb_additional_mem_pool_size=80M ++innodb_flush_log_at_trx_commit=2 +diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-install smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-install +--- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-install 1969-12-31 19:00:00.000000000 -0500 ++++ smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-install 2022-07-27 23:05:44.866000000 -0400 +@@ -0,0 +1,15 @@ ++#!/bin/bash ++ ++# move to cli dir ++cd /usr/share/cacti/cli ++ ++#install ++/usr/bin/php74 install_cacti.php --accept-eula --install --path=php_binary:/usr/bin/php74 ++ ++#TODO: ++#--automationmode ++#--automationrange with LAN if server-gateway; or only interface if server only ++#--lang (using an array between cacti option and system language) ++# using this to set ldap ? --ldap:dn:... ++# do we need a --mode=upgrade and a --mode=install ++ +diff -Nur --no-dereference smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-ldap +--- smeserver-cacti-1.1.19.old/root/etc/e-smith/events/actions/cacti-ldap 2022-07-27 22:43:12.847000000 -0400 ++++ smeserver-cacti-1.1.19/root/etc/e-smith/events/actions/cacti-ldap 2022-07-27 23:05:44.637000000 -0400 +@@ -19,24 +19,25 @@ + #ldap_group_require 'on' or '' + # then set our admin password + /usr/bin/mysql <,ou=Users,$DN') ON DUPLICATE KEY UPDATE name='ldap_dn'; ++INSERT INTO ${db}.settings VALUES ('auth_method','3') ON DUPLICATE KEY UPDATE name='auth_method'; ++INSERT INTO ${db}.settings VALUES ('cn_full_name','cn') ON DUPLICATE KEY UPDATE name='cn_full_name'; ++INSERT INTO ${db}.settings VALUES ('cn_email','mail') ON DUPLICATE KEY UPDATE name='cn_email'; + ++INSERT INTO ${db}.settings VALUES ('user_template','3') ON DUPLICATE KEY UPDATE name='user_template'; + + # set password of admin + UPDATE ${db}.user_auth SET email_address='admin@${domain}', must_change_password='',password=md5('$adminpass'), enabled='on' WHERE username='admin' and id='1';