www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TOKI...@aol.com
Subject Re: general/6981: [error] (22)Invalid argument: shmctl() could not set segment #
Date Fri, 15 Dec 2000 03:41:00 GMT

> Rob Toor writes...
>
> I compiled apache 1.3.14 with rewrite/mod_ssl modules, when I attempted 
> to run it it said it started up fine, but it didnt start and this was in 
the 
>
> error_log: [error] (22)Invalid argument: shmctl() could not set segment 
#640. 
>
> If you can help me regarding this problem I'd be most greatful. 
> Thanks.

Probably a 'permissions' problem.

The code from http_main that is generating the error
is shown below. Looks like your shmctl( IPC_STAT ) is succeeding
but your shmctl( IPC_SET ) is not.

Notice the second ap_log_error() call down below 
( where your error message is being generated ).

It uses 'ap_user_id' and 'ap_group_id'
permissions when it calls shmctl().

If the permissions are bad then the call will fail
and you will get the error you are seeing.

  From ../src/main/http_main.c

  [snip]
  Code that establishes shared memory segments
  [snip]

  else { 
  /* only worry about permissions if we attached the segment */
  if (shmctl(shmid, IPC_STAT, &shmbuf) != 0) 
    {
     ap_log_error(APLOG_MARK, APLOG_ERR, server_conf,
     "shmctl() could not stat segment #%d", shmid);
    }
  else 
    {
     shmbuf.shm_perm.uid = ap_user_id;
     shmbuf.shm_perm.gid = ap_group_id;
     
     if (shmctl(shmid, IPC_SET, &shmbuf) != 0) 
       {
    ap_log_error(APLOG_MARK, APLOG_ERR, server_conf,
        "shmctl() could not set segment #%d", shmid);
       }

   [snip]

Yours...
Kevin Kiley
CTO, Remote Communications, Inc.
http://www.RemoteCommunications.com

Mime
View raw message