Portál AbcLinuxu, 8. května 2025 20:18
setuid()
.
#/usr/sbin/named -u nameda syslog napovi, ze je potreba napravit prava /var/run/named
Mar 16 14:19:56 qwebox named[7358]: couldn't open pid file '/var/run/named/named.pid': Permission denied Mar 16 14:19:56 qwebox named[7358]: exiting (due to early fatal error)
#!/bin/sh # Start/stop/restart the BIND name server daemon (named). # Start bind. In the past it was more secure to run BIND # as a non-root user (for example, with '-u daemon'), but # the modern version of BIND knows how uses to use the # kernel's capability mechanism to drop all root privileges # except the ability to bind() to a privileged port and set # process resource limits, so -u should not be needed. If # you wish to use it anyway, chown the /var/run/named # directory to the non-root user. # # You might also consider running BIND in a "chroot jail", # a discussion of which may be found in # /usr/doc/Linux-HOWTOs/Chroot-BIND-HOWTO. bind_start() { if [ -x /usr/sbin/named ]; then echo "Starting BIND: /usr/sbin/named" /usr/sbin/named fi } # Stop bind: bind_stop() { killall named } # Restart bind: bind_restart() { bind_stop sleep 1 bind_start } case "$1" in 'start') bind_start ;; 'stop') bind_stop ;; 'restart') bind_restart ;; *) echo "usage $0 start|stop|restart" esacJe teda fakt ze defaultne named bezi pod rootem, i kdyz jsem nastavil prava /var/run/named na 777 a restartoval named porad bezi pod rootem. P.S.: Jestli to treba neni tim ze jsi nevyrobil toho usera named. Zdenek
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.