doc: Update Japanese lxc-stop(1) for -s option

Update for commit 25070b660187b61aa4e969db01b55d1360639543

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
doc: Fix the description of -n option in lxc-info(1)

Commit 5444216 revised -n option from allowing to specify multiple
containers using regex to specifying only one container. But
lxc-info(1) remains original. so
- mark -n required
- remove the description of -n that is included in common options

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Remove process_lock() except where actually needed

Functions like open(), close(), socket(), socketpair(), pipe() and mkdir()
are generally thin wrappers around kernel-provided system calls.
It's the kernel not libc, who ensures race-free handling of file
descriptors.
Thus locking around these functions is unnecessary even on somewhat buggy libcs.

fopen(), fclose() and other stdio functions may maintain internal lists
of open file handles and thus can be prone to race-conditions.
Hopefully, most libcs utilize proper locking or other ways to ensure
thread-safety of these functions.
Bionic used to have non-thread-safe stdio [2] but that must be fixed
since android 4.3 [3, 4].

S.Çağlar Onur showed [1] that openpty() (because of nsswitch) is not thread-safe though.
So we workaround it by protecting openpty() calls with process_lock()/process_unlock().

Because of the need to guard openpty() with process_lock()/process_unlock(),
process_unlock() is still used after fork().

This commit reverts most of 025ed0f3911836b71f498d8368725c77a7e1932a.

[1] https://github.com/lxc/lxc/pull/106#issuecomment-31077269
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=687367
[3] https://android.googlesource.com/platform/bionic/+/f582340a6a48588aa50da17e1620e8f91b146941
[4] https://android.googlesource.com/platform/bionic/+/6b3f49a5374305ce9690c3c5ca2aadc90f54c521

Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Use getmntent_r() for thread-safety

Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
coverity: make sure not to close file handle twice

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
lxc-autostart: don't set timeout if user requested -s

same as the commit 25070b660187b61aa4e969db01b55d1360639543

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
add travis-ci support to LXC github repo (v2)

Travis is a free hosted CI platform for the open source community. It integrates
well with github and enables continous builds/tests for both repository itself
and all the pull requests so that one can quickly see the result of the possible
merge.

This yml file is one of the few required steps to enable travis-ci support for
LXC github repo. One of you guys still need to sign in travis-ci through GitHub OAuth
and enable travis support from its profile page https://travis-ci.org/profile

As an example https://travis-ci.org/caglar10ur/lxc-upstream/builds/15872074 can be seen

changes since v1;
 - All external dependencies are now innstalled via before_install section
 - Dropped all configure flags as Stéphane suggested

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
plamo: Improve template for lxc-stop

patch /etc/inittab in plamo container to shutdown when it receives SIGPWR.
(By default, plamo shutdowns to single user mode after 5minutes)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Allow use of public API from C++

Signed-off-by: Andrey Mazo <mazo@telum.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Remove unused functions

After 95ee490bbdb97ab2b4f1dfa63a0a26e0dd1c2f17 they are not in public
API and are not used throughout the lxc codebase.
This has a bonus of removing workaround for bionic.

Signed-off-by: Andrey Mazo <mazo@telum.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Fix version checking and deal with pam_loginuid in CentOS template.

This deals with a reported issue when running and building containers
on a CentOS host system.

Fixed various typos in version checking when running on a CentOS system.
Added logic for differences between point releases (6.5) and rolling (6).
Added version detection logic when running on RHEL systems as well.
Fixed cpe detection string (CentOS is not adhering to their own registration).
Added logic to disable the pam_loginuid.so binary in containers.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Fix version checking typos in Fedora template.

Backported typo fixes from CentOS template back to Fedora Template
Bumped default rev from Fedora 18 to Fedora 19

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
travis: Enable tests and add missing dependencies

 - Add doxygen and graphviz for the API doc build.
 - Pass --enable-tests to have the tests built (off by default)

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
travis: Configure notifications

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
adjust include statements (v2)

Use "#include <somefile.h>" style for external or exported headers only.

changes since v1:
 - adjusted formatting as Stéphane suggested

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Use pthread_atfork() to unlock mutexes after fork()

Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
doc: Improve Japanese man pages

* Improve Japanese translation
* Fix mis-translation
* Insert linefeed between paragraph, because some paragraph is too
  long, so sometimes git send-email could not use.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
lxclock: fall back to /tmp if xdg_rundir is not writeable

This happens for instance if you run a test under sudo which
then runs lxc commands under 'su - <someuser>'

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
start of lxc-unpriv test

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
lxcunpriv update

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>