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

« back to all changes in this revision

Viewing changes to src/socket.h

  • 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:
28
28
#include "unit.h"
29
29
#include "socket-util.h"
30
30
#include "mount.h"
 
31
#include "service.h"
31
32
 
32
33
typedef enum SocketState {
33
34
        SOCKET_DEAD,
64
65
        _SOCKET_FIFO_INVALID = -1
65
66
} SocketType;
66
67
 
 
68
typedef enum SocketResult {
 
69
        SOCKET_SUCCESS,
 
70
        SOCKET_FAILURE_RESOURCES,
 
71
        SOCKET_FAILURE_TIMEOUT,
 
72
        SOCKET_FAILURE_EXIT_CODE,
 
73
        SOCKET_FAILURE_SIGNAL,
 
74
        SOCKET_FAILURE_CORE_DUMP,
 
75
        SOCKET_FAILURE_SERVICE_FAILED_PERMANENT,
 
76
        _SOCKET_RESULT_MAX,
 
77
        _SOCKET_RESULT_INVALID = -1
 
78
} SocketResult;
 
79
 
67
80
typedef struct SocketPort {
68
81
        SocketType type;
69
82
        int fd;
76
89
} SocketPort;
77
90
 
78
91
struct Socket {
79
 
        Meta meta;
 
92
        Unit meta;
80
93
 
81
94
        LIST_HEAD(SocketPort, ports);
82
95
 
93
106
        /* For Accept=no sockets refers to the one service we'll
94
107
        activate. For Accept=yes sockets is either NULL, or filled
95
108
        when the next service we spawn. */
96
 
        Service *service;
 
109
        UnitRef service;
97
110
 
98
111
        SocketState state, deserialized_state;
99
112
 
103
116
        SocketExecCommand control_command_id;
104
117
        pid_t control_pid;
105
118
 
106
 
        /* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */
107
 
        SocketAddressBindIPv6Only bind_ipv6_only;
108
 
 
109
119
        mode_t directory_mode;
110
120
        mode_t socket_mode;
111
121
 
112
 
        bool failure;
 
122
        SocketResult result;
113
123
 
114
124
        bool accept;
115
125
 
118
128
        bool free_bind;
119
129
        bool transparent;
120
130
        bool broadcast;
 
131
        bool pass_cred;
 
132
        bool pass_sec;
121
133
        int priority;
122
134
        int mark;
123
135
        size_t receive_buffer;
129
141
        char *tcp_congestion;
130
142
        long mq_maxmsg;
131
143
        long mq_msgsize;
 
144
 
 
145
        /* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */
 
146
        SocketAddressBindIPv6Only bind_ipv6_only;
132
147
};
133
148
 
134
149
/* Called from the service code when collecting fds */
135
150
int socket_collect_fds(Socket *s, int **fds, unsigned *n_fds);
136
151
 
137
152
/* Called from the service when it shut down */
138
 
void socket_notify_service_dead(Socket *s);
 
153
void socket_notify_service_dead(Socket *s, bool failed_permanent);
139
154
 
140
155
/* Called from the mount code figure out if a mount is a dependency of
141
156
 * any of the sockets of this socket */
152
167
const char* socket_exec_command_to_string(SocketExecCommand i);
153
168
SocketExecCommand socket_exec_command_from_string(const char *s);
154
169
 
 
170
const char* socket_result_to_string(SocketResult i);
 
171
SocketResult socket_result_from_string(const char *s);
 
172
 
155
173
#endif