tcpsrv dies when started via sudo ...

Questions regarding the DCMPRINT library, a DCMTK add-on that implements a DICOM Print Management SCP and SCU

Moderator: Moderator Team

Post Reply
Message
Author
geroldgruber
Posts: 3
Joined: Thu, 2007-03-15, 10:27
Location: Froendenberg, NRW, Germany
Contact:

tcpsrv dies when started via sudo ...

#1 Post by geroldgruber »

We run dicomprint an a linux box and want to add a menu point
in the menus of the windowmanager - allowing a normal
user to restart the tcpsrv process.

The sudo works in principle, the service ist stopped and started again,
but when the shell, that was called to run the /etc/init.d/dcmprint
script dies, the tcpsrv process dies also.
Verified with an appended sleep in the start script - as long as the
shell exists the process is fine and the ports are open - shell gone,
tcpsrv gone.

/etc/init.d/dcmprint runs fine on system start and when called from
root in an xterm or on console or putty or whatsoever,
but not with sudo.

Any idea?

Best regards

Gerold

geroldgruber
Posts: 3
Joined: Thu, 2007-03-15, 10:27
Location: Froendenberg, NRW, Germany
Contact:

#2 Post by geroldgruber »

BTW, nohup doesn't help, at least in my first test

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1437
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#3 Post by Marco Eichelberg »

Does the /etc/init.d start script (which is not part of DCMPRINT) start the server process in the background? If not, then one tcpsrv process instance will run in the context of the script.

That said, in general we do not recommend to run tcpsrv with root privileges. It is preferrable to install the tool with s-bit set (mode 4755) and owner root. In this case any user can start tcpsrv, but after opening the listen socket (which requires root privileges if < 1024) the tool reverts to the effective user ID by calling setuid(getuid()), which limits the possible damage the tool can cause in case things go wrong badly.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest