~ubuntu-branches/debian/jessie/systemd/jessie

« back to all changes in this revision

Viewing changes to man/sd_pid_get_session.3

  • Committer: Package Import Robot
  • Author(s): Tollef Fog Heen, Tollef Fog Heen, Michael Biebl
  • Date: 2012-04-03 19:59:17 UTC
  • mfrom: (1.1.10) (6.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20120403195917-l532urrbg4pkreas
Tags: 44-1
[ Tollef Fog Heen ]
* New upstream version.
  - Backport 3492207: journal: PAGE_SIZE is not known on ppc and other
    archs
  - Backport 5a2a2a1: journal: react with immediate rotation to a couple
    of more errors
  - Backport 693ce21: util: never follow symlinks in rm_rf_children()
    Fixes CVE-2012-1174, closes: #664364
* Drop output message from init-functions hook, it's pointless.
* Only rmdir /lib/init/rw if it exists.
* Explicitly order debian-fixup before sysinit.target to prevent a
  possible race condition with the creation of sockets.  Thanks to
  Michael Biebl for debugging this.
* Always restart the initctl socket on upgrades, to mask sysvinit
  removing it.

[ Michael Biebl ]
* Remove workaround for non-interactive sessions from pam config again.
* Create compat /dev/initctl symlink in case we are upgrading from a system
  running a newer version of sysvinit (using /run/initctl) and sysvinit is
  replaced with systemd-sysv during the upgrade. Closes: #663219
* Install new man pages.
* Build-Depend on valac (>= 0.12) instead of valac-0.12. Closes: #663323

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'\" t
 
2
.\"     Title: sd_pid_get_session
 
3
.\"    Author: Lennart Poettering <lennart@poettering.net>
 
4
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
 
5
.\"      Date: 03/16/2012
 
6
.\"    Manual: sd_pid_get_session
 
7
.\"    Source: systemd
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "SD_PID_GET_SESSION" "3" "03/16/2012" "systemd" "sd_pid_get_session"
 
11
.\" -----------------------------------------------------------------
 
12
.\" * Define some portability stuff
 
13
.\" -----------------------------------------------------------------
 
14
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
15
.\" http://bugs.debian.org/507673
 
16
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
 
17
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
18
.ie \n(.g .ds Aq \(aq
 
19
.el       .ds Aq '
 
20
.\" -----------------------------------------------------------------
 
21
.\" * set default formatting
 
22
.\" -----------------------------------------------------------------
 
23
.\" disable hyphenation
 
24
.nh
 
25
.\" disable justification (adjust text to left margin only)
 
26
.ad l
 
27
.\" -----------------------------------------------------------------
 
28
.\" * MAIN CONTENT STARTS HERE *
 
29
.\" -----------------------------------------------------------------
 
30
.SH "NAME"
 
31
sd_pid_get_session, sd_pid_get_unit, sd_pid_get_owner_uid \- Determine session, service or owner of a session of a specific PID
 
32
.SH "SYNOPSIS"
 
33
.sp
 
34
.ft B
 
35
.nf
 
36
#include <systemd/sd\-login\&.h>
 
37
.fi
 
38
.ft
 
39
.HP \w'int\ sd_pid_get_session('u
 
40
.BI "int sd_pid_get_session(pid_t\ " "pid" ", char**\ " "session" ");"
 
41
.HP \w'int\ sd_pid_get_unit('u
 
42
.BI "int sd_pid_get_unit(pid_t\ " "pid" ", char**\ " "unit" ");"
 
43
.HP \w'int\ sd_pid_get_owner_uid('u
 
44
.BI "int sd_pid_get_owner_uid(pid_t\ " "pid" ", uid_t*\ " "uid" ");"
 
45
.SH "DESCRIPTION"
 
46
.PP
 
47
\fBsd_pid_get_session()\fR
 
48
may be used to determine the login session identifier of a process identified by the specified process identifier\&. The session identifier is a short string, suitable for usage in file system paths\&. Note that not all processes are part of a login session (e\&.g\&. system service processes, user processes that are shared between multiple sessions of the same user, or kernel threads)\&. For processes not being part of a login session this function will fail\&. The returned string needs to be freed with the libc
 
49
\fBfree\fR(3)
 
50
call after use\&.
 
51
.PP
 
52
\fBsd_pid_get_unit()\fR
 
53
may be used to determine the systemd unit (i\&.e\&. system service) identifier of a process identified by the specified process identifier\&. The unit name is a short string, suitable for usage in file system paths\&. Note that not all processes are part of a unit/service (e\&.g\&. user processes, or kernel threads)\&. For processes not being part of a systemd unit/system service this function will fail\&. The returned string needs to be freed with the libc
 
54
\fBfree\fR(3)
 
55
call after use\&.
 
56
.PP
 
57
\fBsd_pid_get_owner_uid()\fR
 
58
may be used to determine the Unix user identifier of the owner of the session of a process identified the specified PID\&. Note that this function will succeed for user processes which are shared between multiple login sessions of the same user, where
 
59
\fBsd_pid_get_session()\fR
 
60
will fail\&. For processes not being part of a login session and not being a shared process of a user this function will fail\&.
 
61
.PP
 
62
If the
 
63
pid
 
64
paramater of any of these functions is passed as 0 the operation is executed for the calling process\&.
 
65
.SH "RETURN VALUE"
 
66
.PP
 
67
On success these calls return 0 or a positive integer\&. On failure, these calls return a negative errno\-style error code\&.
 
68
.SH "NOTES"
 
69
.PP
 
70
The
 
71
\fBsd_pid_get_session()\fR,
 
72
\fBsd_pid_get_pid()\fR, and
 
73
\fBsd_pid_get_owner_uid()\fR
 
74
interfaces are available as shared library, which can be compiled and linked to with the
 
75
libsystemd\-login
 
76
\fBpkg-config\fR(1)
 
77
file\&.
 
78
.PP
 
79
Note that the login session identifier as returned by
 
80
\fBsd_pid_get_session()\fR
 
81
is completely unrelated to the process session identifier as returned by
 
82
\fBgetsid\fR(2)\&.
 
83
.SH "SEE ALSO"
 
84
.PP
 
85
 
 
86
\fBsystemd\fR(1),
 
87
\fBsd-login\fR(7),
 
88
\fBsd_session_is_active\fR(3),
 
89
\fBgetsid\fR(2)
 
90
.SH "AUTHOR"
 
91
.PP
 
92
\fBLennart Poettering\fR <\&lennart@poettering\&.net\&>
 
93
.RS 4
 
94
Developer
 
95
.RE