Pakfire an den neuen Server angepasst.

Die Pakete wurden nicht richtig gebaut, da die speiziellen Scripts nicht beruecksichtigt wurden.
Fix in der mpfire makefile.
syslogdctrl sollte nun die Direktiven besser ersetzen.


git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@906 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2007-09-22 10:48:09 +00:00
parent 1609fbfdaa
commit 4c7fa778d4
9 changed files with 22 additions and 28 deletions

View File

@@ -30,7 +30,7 @@
int main(void)
{
char buffer[STRING_SIZE], hostname[STRING_SIZE], varmessages[STRING_SIZE];
char buffer[STRING_SIZE], command[STRING_SIZE], hostname[STRING_SIZE], varmessages[STRING_SIZE];
int config_fd,rc,fd,pid;
struct stat st;
struct keyvalue *kv = NULL;
@@ -111,10 +111,8 @@ int main(void)
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@\\).\\+$/\\1%s/' /etc/syslog.conf >&%d", hostname, config_fd );
else
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@.\\+\\)$/#\\1/' /etc/syslog.conf >&%d", config_fd );
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's#\\.\\*/var/log/messages\\.\\*#%s /var/log/messages#' /etc/syslog.conf >&%d", varmessages, config_fd );
/* if the return code isn't 0 failsafe */
/* if the return code isn't 0 failsafe */
if ((rc = unpriv_system(buffer,99,99)) != 0)
{
fprintf(stderr, "sed returned bad exit code: %d\n", rc);
@@ -123,6 +121,13 @@ int main(void)
exit(ERR_CONFIG);
}
close(config_fd);
/* Replace the logging option*/
safe_system("grep -v '/var/log/messages' < /etc/syslog.conf.new > /etc/syslog.conf.tmp && mv /etc/syslog.conf.tmp /etc/syslog.conf.new");
snprintf(command, STRING_SIZE-1, "printf '%s /var/log/messages' >> /etc/syslog.conf.new", varmessages );
safe_system(command);
if (rename("/etc/syslog.conf.new", "/etc/syslog.conf") == -1)
{
perror("Unable to replace old config file");