Editing
Upstart issues
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Notes for older kernels === If you encounter upstart errors like this: $ vserver foo start init: missing runlevel Try `init --help' for more information. or $ vserver foo start telinit: Failed to connect to socket /com/ubuntu/upstart: Connection refused then you're probably running the current stable version <code>2.6.22.19-vs2.2.0.7</code>. Upstart's <code>/sbin/init</code> implementation requires it to be PID 1. It is linked against NPTL (in contrast to sysvinit), which has a bug in its caching <code>getpid(2)</code> wrapper. With this kernel version <code>getpid(2)</code> returns the cached PID to init, resulting in init replacing itself with telinit. You can fix this by upgrading to a <code>2.6.26+</code> kernel and a newer vserver patch, or by patching upstart: diff --git a/init/main.c b/init/main.c index bfcd528..c6c9304 100644 --- a/init/main.c +++ b/init/main.c @@ -37,6 +37,7 @@ #include <string.h> #include <syslog.h> #include <unistd.h> +#include <syscall.h> #include <linux/kd.h> @@ -131,7 +132,7 @@ main (int argc, } /* Check we're process #1 */ - if (getpid () > 1) { + if (syscall(SYS_getpid) > 1) { execv (TELINIT, argv); /* Ignore failure, probably just that telinit doesn't exist */ For more information see the man pages of <code>getpid(2)</code> (NOTES) and <code>clone(2)</code> (BUGS).
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information