Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run Apache with fcgid - cannot create shared memory #693

Closed
mstrelan opened this issue Jul 27, 2016 · 16 comments
Closed

Unable to run Apache with fcgid - cannot create shared memory #693

mstrelan opened this issue Jul 27, 2016 · 16 comments

Comments

@mstrelan
Copy link

I'm trying to configure Apache to run with fcgid, but Apache won't start. I have tested this in a VM and it worked fine, but does not work in lxss.

sudo su
apt-get install apache2 apache2-suexec libapache2-mod-fcgid php5-cgi
a2dismod php5
a2enmod rewrite
a2enmod suexec
a2enmod include
a2enmod fcgid
/etc/init.d/apache2 restart

After 20 seconds Apache fails to start and the following error appears in /var/log/apache2/error.log

[Wed Jul 27 14:14:18.001784 2016] [fcgid:emerg] [pid 29715] (38)Function not implemented: mod_fcgid: Can't create shared memory for size 1200712 bytes

I'm on build 14393.5.

I'm not too sure, but this might be related to #135.

@stehufntdev
Copy link
Collaborator

Thanks for reporting the issue, can you please share out a strace of the failing process so we can see what is failing?

@mstrelan
Copy link
Author

Is this what you need? Sorry, I'm not familiar with strace

fcgid_strace.txt

@stehufntdev
Copy link
Collaborator

Thanks for collecting the trace. It looks like that only has the information for the parent process and it's likely a child process reporting the error above. Can you try the following command line to collect the child processes as well, strace -f -o <File.txt> -s 256 <Binary>?

@mstrelan
Copy link
Author

fcgid_strace2.txt

Try this one. Thanks for looking in to this BTW.

@stehufntdev
Copy link
Collaborator

Glad to help, thanks for collecting the traces. Going through the strace it looks like the failure is coming from some socket options that aren't supported. I'll make sure we are tracking these socket options so we can prioritize appropriately.

strace snip
1257 setsockopt(6, SOL_TCP, TCP_DEFER_ACCEPT, [30], 4) = -1 EINVAL (Invalid argument)
...
1257 setsockopt(4, SOL_TCP, TCP_DEFER_ACCEPT, [30], 4) = -1 EINVAL (Invalid argument)
...
1257 write(2, "[Fri Jul 29 18:01:55.862329 2016] [fcgid:emerg] pid 1257Function not implemented: mod_fcgid: Can't create shared memory for size 1200712 bytes\n", 150) = 150

@mstrelan
Copy link
Author

FWIW those first two errors appear without fcgid enabled and Apache still
starts.

On 29 Jul 2016 11:52 PM, "stehufntdev" [email protected] wrote:

Glad to help, thanks for collecting the traces. Going through the strace
it looks like the failure is coming from some socket options that aren't
supported. I'll make sure we are tracking these socket options so we can
prioritize appropriately.

strace snip
1257 setsockopt(6, SOL_TCP, TCP_DEFER_ACCEPT, [30], 4) = -1 EINVAL
(Invalid argument)
...
1257 setsockopt(4, SOL_TCP, TCP_DEFER_ACCEPT, [30], 4) = -1 EINVAL
(Invalid argument)
...
1257 write(2, "[Fri Jul 29 18:01:55.862329 2016] [fcgid:emerg] pid 1257
http://38Function not implemented: mod_fcgid: Can't create shared
memory for size 1200712 bytes\n", 150) = 150


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#693 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAomFrrt1hZGg3OcjBHx76s6HyH0hvITks5qagW2gaJpZM4JV2b5
.

@shinji257
Copy link

Just a thought but isn't shared memory (shm) support currently missing from WSL?

@stehufntdev
Copy link
Collaborator

Posix shared memory through /dev/shm should be working, but the system v shared memory system calls are not currently supported. In the strace I didn't see any hits for the system v syscalls.

@nh905
Copy link

nh905 commented Aug 13, 2016

@stehufntdev, I am seeing the same problem on WSL (Windows 10 Home, version 1607). I successfully installed a simple apache2 configuration that seemed to work. I then tried to install the virtualmin webserver management platform - apache2 would not start due to the following errors:

[Fri Aug 12 20:12:54.764914 2016] [auth_digest:error] [pid 30884] (38)Function not implemented: AH01762: Failed to create shared memory segment on file /var/run/apache2/authdigest_shm.30884
[Fri Aug 12 20:12:54.764914 2016] [auth_digest:error] [pid 30884] (38)Function not implemented: AH01760: failed to initialize shm - all nonce-count checking, one-time nonces, and MD5-sess algorithm disabled

I disabled slotmem_shm_module, socache_shmcb_module and auth_digest_module - now I get the same fcgid error as mstrelan. Another post suggested checking ipcs values - here is the response.

# ipcs -m
kernel not configured for shared memory

I will try switching to mod_php to see if that lets me continue configuring virtualmin. I realize I am asking a lot but it will be a good test of the WSL features.

@WSLUser
Copy link

WSLUser commented Jan 16, 2018

Do we have any updates with this? This issue hasn't been resolved yet with Build 16299. There are other things that require shared memory other than Apache and would help alleviate some error messages.

@shinji257
Copy link

Try using the Ubuntu release on the Windows Store. It can actually run along side the legacy release.

@WSLUser
Copy link

WSLUser commented Jan 16, 2018

@shinji257 I don't use the legacy release. I switched as soon as it was available on FCU. My specific notice of this issue actually is similar to this issue but it wasn't a permission error I was seeing. Strace will be posted as soon as I have time for it.

@sunilmut
Copy link
Member

I am not able to reproduce this issue on build 17074. Has anyone tried it recently?

@therealkenc
Copy link
Collaborator

Gonna guess it was fixed with #1016 release 15002. SOL_TCP, TCP_DEFER_ACCEPT should be opened if it is still outstanding.

@mstrelan
Copy link
Author

I tried to reproduce this with the commands provided in the OP but Apache starts just fine. I can't believe I've been running WSL for 18 months already... seems this is fixed.

@therealkenc
Copy link
Collaborator

TCP_DEFER_ACCEPT should be opened if it is still outstanding.

It is, ref #1953.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants