About this list Date view Thread view Subject view Author view Attachment view

From: Paul Sladen (vserver_at_paul.sladen.org)
Date: Fri 08 Nov 2002 - 03:15:35 GMT


On Thu, 7 Nov 2002, Justin M Kuntz wrote:

> rsync -vazP /vservers/0001/ machine-b:/vservers/0001

I'm assuming you didn't recursively copy /proc across?

> pidof: can't read sid from /proc/638/stat

The reason for wanting the session ID is given here:

] * kilall5.c Kill all processes except processes that have the
] * same session id, so that the shell that called us
] * won't be killed. Typically used in shutdown scripts.

The code that throws this error is:

] /* Open the status file. */
] snprintf(path, sizeof(path), "/proc/%s/stat", d->d_name);
] [...]
] /* This could be replaced by getsid(pid) */
] if (sscanf(q, "%*c %*d %*d %d", &p->sid) != 1) {
] p->sid = 0;
] nsyslog(LOG_ERR, "can't read sid from %s\n",
] path);
] free(p);
] continue;
] }

It is expecting to find a line like:
            v-----------v
  638 (ssh) S 123 638 456 42 [...]
            v----------------------------------v
  pid (cmd) state parent-pid group-id session-id tty

What happens if you do these:

  cat /proc/638/stat
  chcontext --ctx 1 cat /proc/638/stat

(replace `638' by the process number it is complaining about)

The strange thing is that it is not complaining that it cannot *read* the
file in the first place (eg. because it's in another context), only that the
data in it, does not match the scanf() statement above.

        -Paul

-- 
Nottingham, GB


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Fri 08 Nov 2002 - 04:28:54 GMT by hypermail 2.1.3