fedora-sysv / chkconfig Goto Github PK
View Code? Open in Web Editor NEW✔️ A system tool for maintaining the /etc/rc*.d hierarchy.
License: GNU General Public License v2.0
✔️ A system tool for maintaining the /etc/rc*.d hierarchy.
License: GNU General Public License v2.0
CentOS Stream 9 (chkconfig-1.24-1.el9.x86_64, systemd-252-18.el9.x86_64). SysV daemons never show up in systemd. I guess systemdActive()
Lines 948 to 960 in c3511a1
Lines 104 to 107 in c3511a1
is broken. Simple test:
#define _GNU_SOURCE
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
int systemdIsInit() {
char *path = realpath("/sbin/init", NULL);
char *base = NULL;
if (!path)
return 0;
base = basename(path);
if (!base)
return 0;
if (strcmp(base, "systemd"))
return 0;
return 1;
}
int systemdActive() {
struct stat a, b;
if (lstat("/sys/fs/cgroup", &a) < 0)
return 0;
if (lstat("/sys/fs/cgroup/systemd", &b) < 0)
return 0;
if (a.st_dev == b.st_dev)
return 0;
if (!systemdIsInit())
return 0;
return 1;
}
int main(void)
{
printf("systemdIsInit(): %d\n", systemdIsInit());
printf("systemdActive(): %d\n", systemdActive());
return 0;
}
$ gcc test.c
$ ./a.out
systemdIsInit(): 1
systemdActive(): 0
$ sudo ./a.out
systemdIsInit(): 1
systemdActive(): 0
Source file: chkconfig.c
where the function: qsort(services, numServices, sizeof(*services), serviceNameCmp); here the function serviceNameCmp
static int serviceNameCmp(const void *a, const void *b) {
return strcmp(*(char **)a, *(char **)b);
}
may cause function qsort to segfault
Reference: https://stackoverflow.com/questions/33774013/getting-segmentation-fault-when-using-qsort-for-sorting-array-of-strings-in-c
Right now we only return exit code 2. However we should also print brief error message.
steps to reproduce:
1.add a service in /etc/chkconfig as below:
#!/bin/bash
# chkconfig: 8 33 99
echo "test chkconfig --override"
chkconfig
i find memory leak in alternatives.c when using AddressSanitizer.the leak main about reallca, strdup, just few bytes. but multiple code leaks. so i can't not decide to modify it or not, i want to know what does github give suggestion about this issue.
==8212==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 64 byte(s) in 1 object(s) allocated from:
#0 0xffff9f2ab5ab in realloc (/lib64/libasan.so.4+0xd35ab)
#1 0xaaaac8c65e73 (/usr/sbin/alternatives+0x7e73)
#2 0xaaaac8c68437 (/usr/sbin/alternatives+0xa437)
#3 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
Direct leak of 35 byte(s) in 1 object(s) allocated from:
#0 0xffff9f218f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac8c6759b (/usr/sbin/alternatives+0x959b)
#2 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#3 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
Direct leak of 35 byte(s) in 1 object(s) allocated from:
#0 0xffff9f218f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac8c684df (/usr/sbin/alternatives+0xa4df)
#2 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#3 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
#0 0xffff9f218f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac8c68e1b (/usr/sbin/alternatives+0xae1b)
#2 0xaaaac8c66d07 (/usr/sbin/alternatives+0x8d07)
#3 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 47 byte(s) in 1 object(s) allocated from:
#0 0xffff9f218f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac8c68e1b (/usr/sbin/alternatives+0xae1b)
#2 0xaaaac8c66b63 (/usr/sbin/alternatives+0x8b63)
#3 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 46 byte(s) in 1 object(s) allocated from:
#0 0xffff9f218f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac8c68d4b (/usr/sbin/alternatives+0xad4b)
#2 0xaaaac8c66d07 (/usr/sbin/alternatives+0x8d07)
#3 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 45 byte(s) in 1 object(s) allocated from:
#0 0xffff9f218f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac8c68d4b (/usr/sbin/alternatives+0xad4b)
#2 0xaaaac8c66b63 (/usr/sbin/alternatives+0x8b63)
#3 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0xffff9f2ab5ab in realloc (/lib64/libasan.so.4+0xd35ab)
#1 0xaaaac8c66cbb (/usr/sbin/alternatives+0x8cbb)
#2 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#3 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 9 byte(s) in 1 object(s) allocated from:
#0 0xffff9f218f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac8c66e07 (/usr/sbin/alternatives+0x8e07)
#2 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#3 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 6 byte(s) in 1 object(s) allocated from:
#0 0xffff9f218f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac8c68db3 (/usr/sbin/alternatives+0xadb3)
#2 0xaaaac8c66d07 (/usr/sbin/alternatives+0x8d07)
#3 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 5 byte(s) in 1 object(s) allocated from:
#0 0xffff9f218f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac8c68db3 (/usr/sbin/alternatives+0xadb3)
#2 0xaaaac8c66b63 (/usr/sbin/alternatives+0x8b63)
#3 0xffff9f072adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac8c68777 (/usr/sbin/alternatives+0xa777)
SUMMARY: AddressSanitizer: 364 byte(s) leaked in 11 allocation(s).
NEW link: link_a Prio: 10 Family: family_a
=================================================================
==8255==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 128 byte(s) in 1 object(s) allocated from:
#0 0xffffa7c035ab in realloc (/lib64/libasan.so.4+0xd35ab)
#1 0xaaaac5949647 (/usr/sbin/alternatives+0x7647)
#2 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#3 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Direct leak of 47 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac5948fcf (/usr/sbin/alternatives+0x6fcf)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Direct leak of 35 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594c4df (/usr/sbin/alternatives+0xa4df)
#2 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#3 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Direct leak of 35 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594b59b (/usr/sbin/alternatives+0x959b)
#2 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#3 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Direct leak of 32 byte(s) in 1 object(s) allocated from:
#0 0xffffa7c035ab in realloc (/lib64/libasan.so.4+0xd35ab)
#1 0xaaaac594811f (/usr/sbin/alternatives+0x611f)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Direct leak of 24 byte(s) in 1 object(s) allocated from:
#0 0xffffa7c031db in __interceptor_malloc (/lib64/libasan.so.4+0xd31db)
#1 0xaaaac594849f (/usr/sbin/alternatives+0x649f)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Direct leak of 24 byte(s) in 1 object(s) allocated from:
#0 0xffffa7c031db in __interceptor_malloc (/lib64/libasan.so.4+0xd31db)
#1 0xaaaac59493b7 (/usr/sbin/alternatives+0x73b7)
#2 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#3 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Direct leak of 24 byte(s) in 1 object(s) allocated from:
#0 0xffffa7c035ab in realloc (/lib64/libasan.so.4+0xd35ab)
#1 0xaaaac594acbb (/usr/sbin/alternatives+0x8cbb)
#2 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#3 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Direct leak of 13 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59484e7 (/usr/sbin/alternatives+0x64e7)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Direct leak of 1 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59481ef (/usr/sbin/alternatives+0x61ef)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594897b (/usr/sbin/alternatives+0x697b)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 48 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594ce1b (/usr/sbin/alternatives+0xae1b)
#2 0xaaaac594ad07 (/usr/sbin/alternatives+0x8d07)
#3 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 47 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac5948217 (/usr/sbin/alternatives+0x6217)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 47 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594ce1b (/usr/sbin/alternatives+0xae1b)
#2 0xaaaac594ab63 (/usr/sbin/alternatives+0x8b63)
#3 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 46 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac5948147 (/usr/sbin/alternatives+0x6147)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 46 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac5948b57 (/usr/sbin/alternatives+0x6b57)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 46 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594cd4b (/usr/sbin/alternatives+0xad4b)
#2 0xaaaac594ad07 (/usr/sbin/alternatives+0x8d07)
#3 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 45 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac5947fb3 (/usr/sbin/alternatives+0x5fb3)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 45 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59483eb (/usr/sbin/alternatives+0x63eb)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 45 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594cd4b (/usr/sbin/alternatives+0xad4b)
#2 0xaaaac594ab63 (/usr/sbin/alternatives+0x8b63)
#3 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 9 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594ae07 (/usr/sbin/alternatives+0x8e07)
#2 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#3 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 9 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59486af (/usr/sbin/alternatives+0x66af)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 6 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594cdb3 (/usr/sbin/alternatives+0xadb3)
#2 0xaaaac594ad07 (/usr/sbin/alternatives+0x8d07)
#3 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 6 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac5948093 (/usr/sbin/alternatives+0x6093)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 6 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac5948abb (/usr/sbin/alternatives+0x6abb)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 5 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594cdb3 (/usr/sbin/alternatives+0xadb3)
#2 0xaaaac594ab63 (/usr/sbin/alternatives+0x8b63)
#3 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 5 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac5948037 (/usr/sbin/alternatives+0x6037)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 5 byte(s) in 1 object(s) allocated from:
#0 0xffffa7b70f63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac594842b (/usr/sbin/alternatives+0x642b)
#2 0xaaaac594923f (/usr/sbin/alternatives+0x723f)
#3 0xaaaac594c437 (/usr/sbin/alternatives+0xa437)
#4 0xffffa79caadf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#5 0xaaaac594c777 (/usr/sbin/alternatives+0xa777)
SUMMARY: AddressSanitizer: 877 byte(s) leaked in 28 allocation(s).
NEW link: link_b Prio: 20 Family: family_b
=================================================================
==8301==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 128 byte(s) in 1 object(s) allocated from:
#0 0xffffa55f15ab in realloc (/lib64/libasan.so.4+0xd35ab)
#1 0xaaaac59f72d3 (/usr/sbin/alternatives+0x62d3)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Direct leak of 47 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f7fcf (/usr/sbin/alternatives+0x6fcf)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Direct leak of 35 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59fa59b (/usr/sbin/alternatives+0x959b)
#2 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#3 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Direct leak of 35 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59fb4df (/usr/sbin/alternatives+0xa4df)
#2 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#3 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Direct leak of 32 byte(s) in 1 object(s) allocated from:
#0 0xffffa55f15ab in realloc (/lib64/libasan.so.4+0xd35ab)
#1 0xaaaac59f711f (/usr/sbin/alternatives+0x611f)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Direct leak of 26 byte(s) in 2 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f74e7 (/usr/sbin/alternatives+0x64e7)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Direct leak of 5 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59fbb4b (/usr/sbin/alternatives+0xab4b)
#2 0xaaaac59fa0ef (/usr/sbin/alternatives+0x90ef)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Direct leak of 1 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f71ef (/usr/sbin/alternatives+0x61ef)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 96 byte(s) in 2 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f797b (/usr/sbin/alternatives+0x697b)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 92 byte(s) in 2 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f7b57 (/usr/sbin/alternatives+0x6b57)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 90 byte(s) in 2 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f73eb (/usr/sbin/alternatives+0x63eb)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 48 byte(s) in 2 object(s) allocated from:
#0 0xffffa55f11db in __interceptor_malloc (/lib64/libasan.so.4+0xd31db)
#1 0xaaaac59f749f (/usr/sbin/alternatives+0x649f)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 47 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f7bd7 (/usr/sbin/alternatives+0x6bd7)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 47 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f7217 (/usr/sbin/alternatives+0x6217)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 46 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f7147 (/usr/sbin/alternatives+0x6147)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 45 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f6fb3 (/usr/sbin/alternatives+0x5fb3)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 18 byte(s) in 2 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f76af (/usr/sbin/alternatives+0x66af)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 12 byte(s) in 2 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f7abb (/usr/sbin/alternatives+0x6abb)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 10 byte(s) in 2 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f742b (/usr/sbin/alternatives+0x642b)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 6 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f7093 (/usr/sbin/alternatives+0x6093)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Indirect leak of 5 byte(s) in 1 object(s) allocated from:
#0 0xffffa555ef63 in strdup (/lib64/libasan.so.4+0x40f63)
#1 0xaaaac59f7037 (/usr/sbin/alternatives+0x6037)
#2 0xaaaac59fa95b (/usr/sbin/alternatives+0x995b)
#3 0xffffa53b8adf in __libc_start_main (/lib64/libc.so.6+0x20adf)
#4 0xaaaac59fb777 (/usr/sbin/alternatives+0xa777)
Line 372 in 6b78426
Translations haven’t been updated in 4 years. It would be great if you could regularly push/pull translations to/from https://fedora.zanata.org/project/view/chkconfig.
Per the IETF's draft-knodel-terminology memo and Inclusive Naming Initiative (of which the Linux Foundation and Red Hat are both members of), please consider deprecating the use of "master/slave
" terminology in this program and replacing them with a more inclusive pair like "leader/follower
".
Given that there will be some use-cases or scripts out there that will rely on alternatives
current behaviour and parameters for years to come, I'm under no illusion that compatibility/legacy shims will be around for years if not a decade or more to come.
Packit failed on creating pull-requests in dist-git (https://src.fedoraproject.org/rpms/chkconfig.git):
dist-git branch | error |
---|---|
f36 |
See https://dashboard.packit.dev/results/propose-downstream/2422 |
f37 |
See https://dashboard.packit.dev/results/propose-downstream/2421 |
f38 |
See https://dashboard.packit.dev/results/propose-downstream/2423 |
rawhide |
See https://dashboard.packit.dev/results/propose-downstream/2420 |
You can retrigger the update by adding a comment (/packit propose-downstream
) into this issue.
Current state with follower name as zabbix-proxy-systemd
:
# alternatives --display zabbix-proxy
zabbix-proxy - status is auto.
link currently points to /usr/sbin/zabbix_proxy_mysql
/usr/sbin/zabbix_proxy_mysql - priority 10
follower zabbix-proxy-systemd: /usr/lib/systemd/system/zabbix-proxy-mysql.service
Current `best' version is /usr/sbin/zabbix_proxy_mysql.
# ls -l /etc/alternatives/zabb*
lrwxrwxrwx. 1 root root 28 Nov 6 12:42 /etc/alternatives/zabbix-proxy -> /usr/sbin/zabbix_proxy_mysql*
lrwxrwxrwx. 1 root root 50 Jan 12 17:33 /etc/alternatives/zabbix-proxy-systemd -> /usr/lib/systemd/system/zabbix-proxy-mysql.service
Try to change that:
# /usr/sbin/update-alternatives --install /usr/sbin/zabbix_proxy zabbix-proxy /usr/sbin/zabbix_proxy_mysql 10 --slave /usr/lib/systemd/system/zabbix-proxy.service zabbix-proxy.service /usr/lib/systemd/system/zabbix-proxy-mysql.service --verbose
reading /var/lib/alternatives/zabbix-proxy
Things are broken:
# ls -l /etc/alternatives/zabbix* /usr/lib/systemd/system/zabbix-proxy.service
ls: cannot access '/usr/lib/systemd/system/zabbix-proxy.service': No such file or directory
lrwxrwxrwx. 1 root root 28 Nov 6 12:42 /etc/alternatives/zabbix-proxy -> /usr/sbin/zabbix_proxy_mysql*
# # alternatives --display zabbix-proxy
zabbix-proxy - status is auto.
link currently points to /usr/sbin/zabbix_proxy_mysql
/usr/sbin/zabbix_proxy_mysql - priority 10
Current `best' version is /usr/sbin/zabbix_proxy_mysql.
If it is run again, then we are working:
# /usr/sbin/update-alternatives --install /usr/sbin/zabbix_proxy zabbix-proxy /usr/sbin/zabbix_proxy_mysql 10 --slave /usr/lib/systemd/system/zabbix-proxy.service zabbix-proxy.service /usr/lib/systemd/system/zabbix-proxy-mysql.service --verbose
reading /var/lib/alternatives/zabbix-proxy
# ls -l /etc/alternatives/zabbix* /usr/lib/systemd/system/zabbix-proxy.service
lrwxrwxrwx. 1 root root 28 Nov 6 12:42 /etc/alternatives/zabbix-proxy -> /usr/sbin/zabbix_proxy_mysql*
lrwxrwxrwx. 1 root root 50 Jan 12 17:38 /etc/alternatives/zabbix-proxy.service -> /usr/lib/systemd/system/zabbix-proxy-mysql.service
lrwxrwxrwx. 1 root root 38 Jan 12 17:38 /usr/lib/systemd/system/zabbix-proxy.service -> /etc/alternatives/zabbix-proxy.service
In Makefile you are hardcoding systemd dir to $(DEST)/usr/lib/systemd.
Not all distributions install systemd into /usr/lib.
The message mentioned in the title is shown on this page.
https://translate.fedoraproject.org/projects/fedora-sysv/chkconfig/
It seems to be caused by the branch name change from "master" to "main". Same problem is discussed here and can be resolved by changing the Fedora Weblate settings.
https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/154
beakerlib
is marked as unwanted in RHEL10. Solutions:
bats
)Links:
See this link for more details: https://translate.fedoraproject.org/projects/fedora-sysv/chkconfig/#alerts
Background: as part of my ongoing quest to make all RPM scriptlets deterministic, I'm looking for ways to make every common tool that runs in %pre
or %post
config-file driven rather than code-driven.
alternatives
is one of these, and it's one of the few things that doesn't have a config file format already in use. So I'm proposing that either:
alternatives
grows its own config file format and drop-in directory, or/usr/sbin/alternatives
.So here's an example of a possible simple config file format:
# alternatives config for exim
10 mta /usr/sbin/sendmail /usr/sbin/sendmail.exim
+ mta-mailq /usr/bin/mailq /usr/bin/mailq.exim
+ mta-runq /usr/bin/runq /usr/bin/runq.exim
+ mta-rsmtp /usr/bin/rsmtp /usr/bin/rsmtp.exim
+ mta-rmail /usr/bin/rmail /usr/bin/rmail.exim
+ mta-pam /etc/pam.d/smtp /etc/pam.d/exim
+ mta-newaliases /usr/bin/newaliases /usr/bin/newaliases.exim
+ mta-sendmail /usr/lib/sendmail /usr/lib/sendmail.exim
+ mta-mailqman /usr/share/man/man1/mailq.1.gz /usr/share/man/man8/exim.8.gz
+s exim
#
and run to EOLPRIO NAME LINK PATH
PRIO
must be an integer, obviously--install LINK NAME PATH PRIO
+ NAME LINK PATH
--slave LINK NAME PATH
arguments+s SERVICE
--initscript SERVICE
+i
but these are called "services" now)+f FAMILY
(not used above)
--family FAMILY
Programs/packages that wanted to install alternatives
links could ship a config file like, say, /etc/alternatives.conf.d/exim.conf
. The system could then do something like
/usr/sbin/alternatives --install-from CONF_FILE
to perform the equivalent of the --install ...
commandline, or --remove-from CONF_FILE
to perform the equivalent --remove NAME PATH
action.
We could accomplish this by writing a separate wrapper program that parses the config data and translates it into equivalent alternatives
commandlines, but it seems like this might be something useful to integrate into alternatives
itself.
Does this make sense? Any thoughts, questions, or suggestions? I'll be happy to try to get a patch written to accomplish this if you believe this functionality would be useful.
current message
admindir /var/lib/alternatives invalid
when doing
/usr/sbin/update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7.2.2 300700
Suggest adding : command line arguments here. Example:
admindir /var/lib/alternatives invalid: --install /usr/bin/gcc gcc /usr/bin/gcc-7.2.2 300700
There is an inconsistency in the manual page for alternatives. According to the synopsis section, the "--list" option can be followed by a argument. But further on, description of "--list" disagrees, and so does the code; e.g. "alternatives --help".
files, gitignore, etc.
This is e.g. necessary when running on an rpm-ostree based system
For more context, see:
https://bugzilla.redhat.com/show_bug.cgi?id=1657367
coreos/fedora-coreos-config#264 (comment)
May it better to add a notice although the code means no error.
There seems to be no explanation for the '*' symbol in the list output by alternatives --config
. Why not add an explanation in the output of the command like
*: 'best' selection based on priority
or if not, at least add an explanation on the man page?
Hello, the Fedora project migrates its translation platform to Weblate [1].
This tool directly interact with your git repository, and requires us to know:
Please note:
[1] https://communityblog.fedoraproject.org/fedora-localization-platform-migrates-to-weblate/
[2] https://docs.weblate.org/en/latest/admin/continuous.html#avoiding-merge-conflicts
[3] https://docs.weblate.org/en/latest/user/checks.html#translation-checks
We have a problem in python3.11-wheel package which we can probably solve by ourselves but I think the strange behavior of alternatives I discovered is still worth reporting.
When talking about packages, I mean the ones available in RHEL 8 and I'm using 1minutetip for testing. The most important ones are chkconfig-1.19.1-1.el8.x86_64 and python3.11-wheel-0.38.4-3.el8.noarch.
To reproduce the problem on RHEL 8:
dnf install python36 python3.11
(Python 3.6 is needed later.)alternatives --set python3 /usr/bin/python3.11
dnf install python3.11-wheel
The installation of python3.11-wheel calls this command in its %post
scriptlet:
alternatives --keep-foreign --add-slave python3 /usr/bin/python3.11 /usr/bin/wheel-3 wheel-3 /usr/bin/wheel-3.11
The command produces the following error:
Running scriptlet: python3.11-wheel-0.38.4-3.el8.noarch 1/1
failed to link /usr/bin/wheel-3 -> /etc/alternatives/wheel-3: /usr/bin/wheel-3 exists and it is either not a symlink or --keep-foreign was set and link points outside /etc/alternatives
But, if you set the alternative for python3 to python36 which means that the installation of python3.11-wheel will add the slave into an inactive alternative, it works fine and no error is shown. So these steps are fine:
dnf install python36 python3.11
alternatives --set python3 /usr/bin/python3.6
dnf install python3.11-wheel
If I understand it correctly --keep-foreign
should prevent the --add-slave
from removing/changing a symlink, if it already exists. If that's true, having --add-slave
together with --keep-foreign
makes perfect sense. The problem is that the error message is not true: /usr/bin/wheel-3
does not exist in this case. Alternatives should create that file if you install python3.11-wheel when python3.11 is the active alternative for python3.
To sum this up:
/usr/bin/wheel-3
and shows the error mentioned above./usr/bin/wheel-3
is there and works as expected: /usr/bin/wheel-3 -> /etc/alternatives/wheel-3 -> /usr/bin/wheel-3.11
.Bug report with some more context: https://bugzilla.redhat.com/show_bug.cgi?id=2181479
Does it make sense to use --keep-foreign
with --add-slave
? If so, could we fix the problem? And if not, could we improve the error message to make it clear that this is not supported?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.