├── .gitignore ├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.am ├── NEWS ├── README ├── TODO ├── autogen.sh ├── configure.ac ├── patches └── dbus-fix-sba-for-dbus-activation.patch ├── src ├── launcher.c ├── pam.c └── pam.h └── units ├── system ├── systemd-stop-user-sessions.service.in └── user-session-launch@.service.in └── user ├── cmdline.target.in ├── dbus.service.in ├── dbus.socket.in ├── display-server.target.in ├── enlightenment.service.in ├── gnome-session.service.in ├── graphical.target.in ├── kde.service.in ├── mate-session.service.in ├── mythfrontend.service.in ├── openbox.service.in ├── steam.service.in ├── xbmc.service.in ├── xfce4-session.service.in └── xfwm4.service.in /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | aclocal.m4 4 | autom4te.cache/ 5 | config.log 6 | config.status 7 | configure 8 | install-sh 9 | missing 10 | units/*/*.service 11 | units/*/*.socket 12 | units/*/*.target 13 | *.tar.* 14 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Auke Kok 2 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 489 | 490 | Also add information on how to contact you by electronic and paper mail. 491 | 492 | You should also get your employer (if you work as a programmer) or your 493 | school, if any, to sign a "copyright disclaimer" for the library, if 494 | necessary. Here is a sample; alter the names: 495 | 496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. 498 | 499 | , 1 April 1990 500 | Ty Coon, President of Vice 501 | 502 | That's all there is to it! 503 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkok/user-session-units/152bbce0ab9193139c9998ff9c5def3f096f0550/ChangeLog -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, 5 | Inc. 6 | 7 | Copying and distribution of this file, with or without modification, 8 | are permitted in any medium without royalty provided the copyright 9 | notice and this notice are preserved. This file is offered as-is, 10 | without warranty of any kind. 11 | 12 | Basic Installation 13 | ================== 14 | 15 | Briefly, the shell commands `./configure; make; make install' should 16 | configure, build, and install this package. The following 17 | more-detailed instructions are generic; see the `README' file for 18 | instructions specific to this package. Some packages provide this 19 | `INSTALL' file but do not implement all of the features documented 20 | below. The lack of an optional feature in a given package is not 21 | necessarily a bug. More recommendations for GNU packages can be found 22 | in *note Makefile Conventions: (standards)Makefile Conventions. 23 | 24 | The `configure' shell script attempts to guess correct values for 25 | various system-dependent variables used during compilation. It uses 26 | those values to create a `Makefile' in each directory of the package. 27 | It may also create one or more `.h' files containing system-dependent 28 | definitions. Finally, it creates a shell script `config.status' that 29 | you can run in the future to recreate the current configuration, and a 30 | file `config.log' containing compiler output (useful mainly for 31 | debugging `configure'). 32 | 33 | It can also use an optional file (typically called `config.cache' 34 | and enabled with `--cache-file=config.cache' or simply `-C') that saves 35 | the results of its tests to speed up reconfiguring. Caching is 36 | disabled by default to prevent problems with accidental use of stale 37 | cache files. 38 | 39 | If you need to do unusual things to compile the package, please try 40 | to figure out how `configure' could check whether to do them, and mail 41 | diffs or instructions to the address given in the `README' so they can 42 | be considered for the next release. If you are using the cache, and at 43 | some point `config.cache' contains results you don't want to keep, you 44 | may remove or edit it. 45 | 46 | The file `configure.ac' (or `configure.in') is used to create 47 | `configure' by a program called `autoconf'. You need `configure.ac' if 48 | you want to change it or regenerate `configure' using a newer version 49 | of `autoconf'. 50 | 51 | The simplest way to compile this package is: 52 | 53 | 1. `cd' to the directory containing the package's source code and type 54 | `./configure' to configure the package for your system. 55 | 56 | Running `configure' might take a while. While running, it prints 57 | some messages telling which features it is checking for. 58 | 59 | 2. Type `make' to compile the package. 60 | 61 | 3. Optionally, type `make check' to run any self-tests that come with 62 | the package, generally using the just-built uninstalled binaries. 63 | 64 | 4. Type `make install' to install the programs and any data files and 65 | documentation. When installing into a prefix owned by root, it is 66 | recommended that the package be configured and built as a regular 67 | user, and only the `make install' phase executed with root 68 | privileges. 69 | 70 | 5. Optionally, type `make installcheck' to repeat any self-tests, but 71 | this time using the binaries in their final installed location. 72 | This target does not install anything. Running this target as a 73 | regular user, particularly if the prior `make install' required 74 | root privileges, verifies that the installation completed 75 | correctly. 76 | 77 | 6. You can remove the program binaries and object files from the 78 | source code directory by typing `make clean'. To also remove the 79 | files that `configure' created (so you can compile the package for 80 | a different kind of computer), type `make distclean'. There is 81 | also a `make maintainer-clean' target, but that is intended mainly 82 | for the package's developers. If you use it, you may have to get 83 | all sorts of other programs in order to regenerate files that came 84 | with the distribution. 85 | 86 | 7. Often, you can also type `make uninstall' to remove the installed 87 | files again. In practice, not all packages have tested that 88 | uninstallation works correctly, even though it is required by the 89 | GNU Coding Standards. 90 | 91 | 8. Some packages, particularly those that use Automake, provide `make 92 | distcheck', which can by used by developers to test that all other 93 | targets like `make install' and `make uninstall' work correctly. 94 | This target is generally not run by end users. 95 | 96 | Compilers and Options 97 | ===================== 98 | 99 | Some systems require unusual options for compilation or linking that 100 | the `configure' script does not know about. Run `./configure --help' 101 | for details on some of the pertinent environment variables. 102 | 103 | You can give `configure' initial values for configuration parameters 104 | by setting variables in the command line or in the environment. Here 105 | is an example: 106 | 107 | ./configure CC=c99 CFLAGS=-g LIBS=-lposix 108 | 109 | *Note Defining Variables::, for more details. 110 | 111 | Compiling For Multiple Architectures 112 | ==================================== 113 | 114 | You can compile the package for more than one kind of computer at the 115 | same time, by placing the object files for each architecture in their 116 | own directory. To do this, you can use GNU `make'. `cd' to the 117 | directory where you want the object files and executables to go and run 118 | the `configure' script. `configure' automatically checks for the 119 | source code in the directory that `configure' is in and in `..'. This 120 | is known as a "VPATH" build. 121 | 122 | With a non-GNU `make', it is safer to compile the package for one 123 | architecture at a time in the source code directory. After you have 124 | installed the package for one architecture, use `make distclean' before 125 | reconfiguring for another architecture. 126 | 127 | On MacOS X 10.5 and later systems, you can create libraries and 128 | executables that work on multiple system types--known as "fat" or 129 | "universal" binaries--by specifying multiple `-arch' options to the 130 | compiler but only a single `-arch' option to the preprocessor. Like 131 | this: 132 | 133 | ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 134 | CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 135 | CPP="gcc -E" CXXCPP="g++ -E" 136 | 137 | This is not guaranteed to produce working output in all cases, you 138 | may have to build one architecture at a time and combine the results 139 | using the `lipo' tool if you have problems. 140 | 141 | Installation Names 142 | ================== 143 | 144 | By default, `make install' installs the package's commands under 145 | `/usr/local/bin', include files under `/usr/local/include', etc. You 146 | can specify an installation prefix other than `/usr/local' by giving 147 | `configure' the option `--prefix=PREFIX', where PREFIX must be an 148 | absolute file name. 149 | 150 | You can specify separate installation prefixes for 151 | architecture-specific files and architecture-independent files. If you 152 | pass the option `--exec-prefix=PREFIX' to `configure', the package uses 153 | PREFIX as the prefix for installing programs and libraries. 154 | Documentation and other data files still use the regular prefix. 155 | 156 | In addition, if you use an unusual directory layout you can give 157 | options like `--bindir=DIR' to specify different values for particular 158 | kinds of files. Run `configure --help' for a list of the directories 159 | you can set and what kinds of files go in them. In general, the 160 | default for these options is expressed in terms of `${prefix}', so that 161 | specifying just `--prefix' will affect all of the other directory 162 | specifications that were not explicitly provided. 163 | 164 | The most portable way to affect installation locations is to pass the 165 | correct locations to `configure'; however, many packages provide one or 166 | both of the following shortcuts of passing variable assignments to the 167 | `make install' command line to change installation locations without 168 | having to reconfigure or recompile. 169 | 170 | The first method involves providing an override variable for each 171 | affected directory. For example, `make install 172 | prefix=/alternate/directory' will choose an alternate location for all 173 | directory configuration variables that were expressed in terms of 174 | `${prefix}'. Any directories that were specified during `configure', 175 | but not in terms of `${prefix}', must each be overridden at install 176 | time for the entire installation to be relocated. The approach of 177 | makefile variable overrides for each directory variable is required by 178 | the GNU Coding Standards, and ideally causes no recompilation. 179 | However, some platforms have known limitations with the semantics of 180 | shared libraries that end up requiring recompilation when using this 181 | method, particularly noticeable in packages that use GNU Libtool. 182 | 183 | The second method involves providing the `DESTDIR' variable. For 184 | example, `make install DESTDIR=/alternate/directory' will prepend 185 | `/alternate/directory' before all installation names. The approach of 186 | `DESTDIR' overrides is not required by the GNU Coding Standards, and 187 | does not work on platforms that have drive letters. On the other hand, 188 | it does better at avoiding recompilation issues, and works well even 189 | when some directory options were not specified in terms of `${prefix}' 190 | at `configure' time. 191 | 192 | Optional Features 193 | ================= 194 | 195 | If the package supports it, you can cause programs to be installed 196 | with an extra prefix or suffix on their names by giving `configure' the 197 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 198 | 199 | Some packages pay attention to `--enable-FEATURE' options to 200 | `configure', where FEATURE indicates an optional part of the package. 201 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE 202 | is something like `gnu-as' or `x' (for the X Window System). The 203 | `README' should mention any `--enable-' and `--with-' options that the 204 | package recognizes. 205 | 206 | For packages that use the X Window System, `configure' can usually 207 | find the X include and library files automatically, but if it doesn't, 208 | you can use the `configure' options `--x-includes=DIR' and 209 | `--x-libraries=DIR' to specify their locations. 210 | 211 | Some packages offer the ability to configure how verbose the 212 | execution of `make' will be. For these packages, running `./configure 213 | --enable-silent-rules' sets the default to minimal output, which can be 214 | overridden with `make V=1'; while running `./configure 215 | --disable-silent-rules' sets the default to verbose, which can be 216 | overridden with `make V=0'. 217 | 218 | Particular systems 219 | ================== 220 | 221 | On HP-UX, the default C compiler is not ANSI C compatible. If GNU 222 | CC is not installed, it is recommended to use the following options in 223 | order to use an ANSI C compiler: 224 | 225 | ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" 226 | 227 | and if that doesn't work, install pre-built binaries of GCC for HP-UX. 228 | 229 | HP-UX `make' updates targets which have the same time stamps as 230 | their prerequisites, which makes it generally unusable when shipped 231 | generated files such as `configure' are involved. Use GNU `make' 232 | instead. 233 | 234 | On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot 235 | parse its `' header file. The option `-nodtk' can be used as 236 | a workaround. If GNU CC is not installed, it is therefore recommended 237 | to try 238 | 239 | ./configure CC="cc" 240 | 241 | and if that doesn't work, try 242 | 243 | ./configure CC="cc -nodtk" 244 | 245 | On Solaris, don't put `/usr/ucb' early in your `PATH'. This 246 | directory contains several dysfunctional programs; working variants of 247 | these programs are available in `/usr/bin'. So, if you need `/usr/ucb' 248 | in your `PATH', put it _after_ `/usr/bin'. 249 | 250 | On Haiku, software installed for all users goes in `/boot/common', 251 | not `/usr/local'. It is recommended to use the following options: 252 | 253 | ./configure --prefix=/boot/common 254 | 255 | Specifying the System Type 256 | ========================== 257 | 258 | There may be some features `configure' cannot figure out 259 | automatically, but needs to determine by the type of machine the package 260 | will run on. Usually, assuming the package is built to be run on the 261 | _same_ architectures, `configure' can figure that out, but if it prints 262 | a message saying it cannot guess the machine type, give it the 263 | `--build=TYPE' option. TYPE can either be a short name for the system 264 | type, such as `sun4', or a canonical name which has the form: 265 | 266 | CPU-COMPANY-SYSTEM 267 | 268 | where SYSTEM can have one of these forms: 269 | 270 | OS 271 | KERNEL-OS 272 | 273 | See the file `config.sub' for the possible values of each field. If 274 | `config.sub' isn't included in this package, then this package doesn't 275 | need to know the machine type. 276 | 277 | If you are _building_ compiler tools for cross-compiling, you should 278 | use the option `--target=TYPE' to select the type of system they will 279 | produce code for. 280 | 281 | If you want to _use_ a cross compiler, that generates code for a 282 | platform different from the build platform, you should specify the 283 | "host" platform (i.e., that on which the generated programs will 284 | eventually be run) with `--host=TYPE'. 285 | 286 | Sharing Defaults 287 | ================ 288 | 289 | If you want to set default values for `configure' scripts to share, 290 | you can create a site shell script called `config.site' that gives 291 | default values for variables like `CC', `cache_file', and `prefix'. 292 | `configure' looks for `PREFIX/share/config.site' if it exists, then 293 | `PREFIX/etc/config.site' if it exists. Or, you can set the 294 | `CONFIG_SITE' environment variable to the location of the site script. 295 | A warning: not all `configure' scripts look for a site script. 296 | 297 | Defining Variables 298 | ================== 299 | 300 | Variables not defined in a site shell script can be set in the 301 | environment passed to `configure'. However, some packages may run 302 | configure again during the build, and the customized values of these 303 | variables may be lost. In order to avoid this problem, you should set 304 | them in the `configure' command line, using `VAR=value'. For example: 305 | 306 | ./configure CC=/usr/local2/bin/gcc 307 | 308 | causes the specified `gcc' to be used as the C compiler (unless it is 309 | overridden in the site shell script). 310 | 311 | Unfortunately, this technique does not work for `CONFIG_SHELL' due to 312 | an Autoconf limitation. Until the limitation is lifted, you can use 313 | this workaround: 314 | 315 | CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 316 | 317 | `configure' Invocation 318 | ====================== 319 | 320 | `configure' recognizes the following options to control how it 321 | operates. 322 | 323 | `--help' 324 | `-h' 325 | Print a summary of all of the options to `configure', and exit. 326 | 327 | `--help=short' 328 | `--help=recursive' 329 | Print a summary of the options unique to this package's 330 | `configure', and exit. The `short' variant lists options used 331 | only in the top level, while the `recursive' variant lists options 332 | also present in any nested packages. 333 | 334 | `--version' 335 | `-V' 336 | Print the version of Autoconf used to generate the `configure' 337 | script, and exit. 338 | 339 | `--cache-file=FILE' 340 | Enable the cache: use and save the results of the tests in FILE, 341 | traditionally `config.cache'. FILE defaults to `/dev/null' to 342 | disable caching. 343 | 344 | `--config-cache' 345 | `-C' 346 | Alias for `--cache-file=config.cache'. 347 | 348 | `--quiet' 349 | `--silent' 350 | `-q' 351 | Do not print messages saying which checks are being made. To 352 | suppress all normal output, redirect it to `/dev/null' (any error 353 | messages will still be shown). 354 | 355 | `--srcdir=DIR' 356 | Look for the package's source code in directory DIR. Usually 357 | `configure' can determine that directory automatically. 358 | 359 | `--prefix=DIR' 360 | Use DIR as the installation prefix. *note Installation Names:: 361 | for more details, including other options available for fine-tuning 362 | the installation locations. 363 | 364 | `--no-create' 365 | `-n' 366 | Run the configure checks, but stop before creating any output 367 | files. 368 | 369 | `configure' also accepts some other, not widely useful, options. Run 370 | `configure --help' for more details. 371 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | -std=gnu99 \ 3 | -fstack-protector \ 4 | -Wall \ 5 | -pedantic \ 6 | -Wstrict-prototypes \ 7 | -Wundef \ 8 | -fno-common \ 9 | -Werror-implicit-function-declaration \ 10 | -Wformat \ 11 | -Wformat-security \ 12 | -Werror=format-security \ 13 | -Wconversion 14 | 15 | bin_PROGRAMS = user-session-launch 16 | 17 | user_session_launch_SOURCES = \ 18 | src/launcher.c \ 19 | src/pam.c 20 | 21 | # FIXME: add pkgconfig checks for these instead 22 | user_session_launch_LDADD = \ 23 | $(LIBSYSTEMD_LIBS) \ 24 | -lpam \ 25 | -lpam_misc 26 | 27 | EXTRA_DIST = patches/dbus-fix-sba-for-dbus-activation.patch 28 | 29 | systemdsystemunitdir = @SYSTEMDSYSTEMUNITDIR@ 30 | systemduserunitdir = @SYSTEMDUSERUNITDIR@ 31 | 32 | systemdsystemunit_DATA = \ 33 | units/system/user-session-launch@.service \ 34 | units/system/systemd-stop-user-sessions.service 35 | 36 | systemduserunit_DATA = \ 37 | units/user/dbus.socket \ 38 | units/user/dbus.service \ 39 | units/user/cmdline.target \ 40 | units/user/graphical.target \ 41 | units/user/display-server.target 42 | 43 | if HAVE_E 44 | systemduserunit_DATA += \ 45 | units/user/enlightenment.service 46 | endif 47 | 48 | if HAVE_XBMC 49 | systemduserunit_DATA += \ 50 | units/user/xbmc.service 51 | endif 52 | 53 | if HAVE_XFCE 54 | systemduserunit_DATA += \ 55 | units/user/xfce4-session.service \ 56 | units/user/xfwm4.service 57 | endif 58 | if HAVE_GNOME 59 | systemduserunit_DATA += \ 60 | units/user/gnome-session.service 61 | endif 62 | if HAVE_MATE 63 | systemduserunit_DATA += \ 64 | units/user/mate-session.service 65 | endif 66 | if HAVE_KDE 67 | systemduserunit_DATA += \ 68 | units/user/kde.service 69 | endif 70 | if HAVE_MYTH 71 | systemduserunit_DATA += \ 72 | units/user/mythfrontend.service 73 | endif 74 | if HAVE_OPENBOX 75 | systemduserunit_DATA += \ 76 | units/user/openbox.service 77 | endif 78 | if HAVE_STEAM 79 | systemduserunit_DATA += \ 80 | units/user/steam.service 81 | endif 82 | 83 | 84 | 85 | install-data-hook: 86 | $(mkinstalldirs) $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/shutdown.target.wants 87 | ln -sf ../systemd-stop-user-sessions.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/shutdown.target.wants/ 88 | 89 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkok/user-session-units/152bbce0ab9193139c9998ff9c5def3f096f0550/NEWS -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | user-session-units 2 | ================== 3 | 4 | This package contains several systemd unit files related to the systemd 5 | user session, aka `systemd --user`. The goal of this package is to 6 | provide an easy way for people to collect, share and deploy systemd 7 | user session installations and help test the systemd user session 8 | core code. 9 | 10 | 11 | Content: 12 | 13 | In the "units" folder, you will find several unit files for the system 14 | domain and the user session. The most critical ones are: 15 | 16 | user/dbus.socket and user/dbus.service - This creates the dbus 17 | session bus for the systemd user session. The session bus should 18 | live under XDG_RUNTIME_DIR, and so the user-session@.service refers 19 | to this bus address. This is needed to make dbus activation under 20 | the user session work. 21 | 22 | default.target - not packaged. This symlink is pointing to the target 23 | unit file that should be started by systemd --user. If invalid, empty 24 | or missing, nothing will happen when you start the user session. 25 | 26 | other - various example units are packaged for several popular Linux 27 | desktop sessions. They are examples, which work for the author, 28 | but may not necessarily function properly on other distributions. 29 | 30 | user-session@.service is obsolete, and you should be automatically 31 | using the systemd-provided user@.service. 32 | 33 | 34 | Prerequisites: 35 | 36 | systemd - required. This package uses the pkg-config file from 37 | systemd to make sure items are installed in the proper locations. 38 | You should use version 186 or higher. 39 | 40 | PAM needs to be enabled in systemd. Your system should have 41 | `pam_systemd.so` used in the `login` or `system-auth` files in 42 | /etc/pam.d. 43 | 44 | xorg-launch-helper - currently required. Xorg by itself does not 45 | run properly as a systemd service. The xorg-launch-helper project 46 | performs this task and installs several unit files that are required 47 | for most of the units in this project to function. 48 | 49 | dbus - current dbus code sends a malformed DBUS_SESSION_BUS_ADDRESS 50 | to any dbus-activated unit under the systemd user session. A patch 51 | is pending upstream to resolve the issue. Until this is accepted, 52 | you need to either apply this patch manually to dbus yourself, or 53 | live without dbus activation. For reference, the bug is here: 54 | https://bugs.freedesktop.org/show_bug.cgi?id=50962. A copy of the 55 | last-good version of the patch can be found in the /patches/ 56 | folder in this source tree. This patch is slated to be part of 57 | dbus-1.6.9 which is as of this writing not yet released. 58 | 59 | permissions - in order for a normal user to start Xorg and control 60 | sound and/or video without seat management, the user running the 61 | session will likely need to be added to the video and audio groups, 62 | and you may have to make Xorg setuid root (4711). This is a 63 | potential security risk, so, use caution. 64 | 65 | 66 | Installation: 67 | 68 | Just run the usual `configure --prefix...; make; make install`. 69 | 70 | Building from git requires running `./autogen.sh` first. 71 | 72 | 73 | Configuration: 74 | 75 | There are two things that need to be done manually by the SA to enable 76 | and configure the user session properly. 77 | 78 | 1) Choose the default target (cmdline or graphical). 79 | 80 | user-session-units ships two targets that can automatically be aliased 81 | to default.target: cmdline.target and graphical.target. cmdline.target 82 | won't start anything automatically, but serves as a target which other 83 | services can add themselves to as dependencies (think multi-user.target). 84 | graphical.target serves exactly the same purpose as the system-provided 85 | graphical.target: as well as starting cmdline.target, it starts a display 86 | server and any graphical services you choose to enable. 87 | 88 | The default target should be set by symlinking default.target to the 89 | target file you desire to be default. The links should be placed in 90 | ${prefix}/systemd/user/ by distributions, in ${sysconfdir}/systemd/user/ 91 | by SAs, and in ~/.config/systemd/user/ by individual users. The targets 92 | can also be automatically linked using `systemctl enable`. 93 | 94 | 2) Choose your window manager, session manager, and autostarting services. 95 | 96 | graphical.target wants two services called window-manager.service and 97 | session-manager.service. These files should be symbolic links to the 98 | service files for your window manager and session manager, respectively. 99 | You may symlink these files manually as described above, or use `systemctl 100 | enable` to do it automatically. 101 | 102 | To make a service automatically start, use exactly the same process as 103 | you would for system units: either manually symlink the target to the 104 | appropriate .wants directory in the locations listed above or use 105 | `systemctl enable`. 106 | 107 | 3) Enable auto-logon/start user session at boot time (optional). 108 | 109 | This should simply be done by the SA running: `systemctl enable 110 | user-session-launch@-.service`. However, 111 | this may not work for some people, but you can manually create the 112 | symlink like this: 113 | 114 | ln -sf /usr/lib/systemd/system/user-session-launch@.service \ 115 | /etc/systemd/system/graphical.target.wants/user-session-launch@seat0-1000.service 116 | 117 | Note that depending on your system, you may have to change the seat 118 | number and user ids. 119 | 120 | This version of user-session-units requires systemd-208 or newer. Older 121 | versions are no longer supported. 122 | 123 | Once you enable auto-logon for a user on a seat, the 124 | user-session-launch daemon will wait for the seat to appear, and tell 125 | logind to spawn a systemd --user on it. From there on, the default 126 | user units in this package can take over. 127 | 128 | The units in this package assume you're going to be running X on 129 | :0. Although you can pass seat name, nothing inside the user session 130 | in this package is properly looking at the seat parameters yet. 131 | 132 | 133 | Debugging: 134 | 135 | You can connect to the user session over dbus and use regular systemctl 136 | commands to start/stop units, look at the state etc. 137 | 138 | root> # su - joe 139 | joe> $ export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/dbus/user_bus_socket 140 | joe> $ systemctl --user 141 | 142 | One useful thing to try is to run dbus-monitor as joe after setting the session 143 | bus address. It will show you if the session bus is functional. 144 | 145 | The system journal should capture all messages output by user session 146 | services. The user is currently not able to see those messages if you 147 | disabled persistent journal logging (IOW, if you don't have /var/log/journal). 148 | 149 | --- 150 | 151 | Download release tarballs here: 152 | http://foo-projects.org/~sofar/user-session-units/ 153 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | 1. Obsolete this package entirely 5 | a) user-session@.service should probably end up back in systemd. 6 | b) xorg-launch-helper should be obsolete once XOrg becomes properly 7 | socket-activated. At which point we should ship the service files 8 | from xorg-launch-helper in xorg-server itself. 9 | c) Same for wayland. 10 | d) All the desktop-specific service files should be shipped by 11 | upstream projects. 12 | 13 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | autoreconf --install 4 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ([2.64]) 5 | AC_INIT([user-session-units], [9], [auke-jan.h.kok@intel.com]) 6 | AM_INIT_AUTOMAKE([]) 7 | AC_CONFIG_FILES([Makefile]) 8 | AC_PROG_CC 9 | 10 | # Systemd is required, obviously 11 | PKG_CHECK_MODULES([SYSTEMD], [systemd]) 12 | 13 | SYSTEMDSYSTEMUNITDIR="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`" 14 | AC_SUBST(SYSTEMDSYSTEMUNITDIR) 15 | SYSTEMDUSERUNITDIR="`$PKG_CONFIG --variable=systemduserunitdir systemd`" 16 | AC_SUBST(SYSTEMDUSERUNITDIR) 17 | SYSTEMDUTILDIR="`$PKG_CONFIG --variable=systemdutildir systemd`" 18 | AC_SUBST(SYSTEMDUTILDIR) 19 | 20 | PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd >= 209]) 21 | 22 | # test for xorg-launch-helper 23 | AC_MSG_CHECKING(for xorg-launch-helper) 24 | if test -f "$SYSTEMDUSERUNITDIR/xorg.target" ; then 25 | result=yes 26 | else 27 | AC_MSG_WARN([xorg-launch-helper is required for most of the units]) 28 | result=no 29 | fi 30 | AC_MSG_RESULT($result) 31 | 32 | # Check for dbus daemon path for the session bus 33 | PKG_CHECK_MODULES([DBUS], [dbus-1]) 34 | DBUSDAEMONDIR="`$PKG_CONFIG --variable=daemondir dbus-1`" 35 | DBUSPREFIX="`$PKG_CONFIG --variable=prefix dbus-1`" 36 | AC_SUBST(DBUSDAEMONDIR) 37 | AC_SUBST(DBUSPREFIX) 38 | 39 | # Should we include units for programs not on the system? (useful for packaging) 40 | AC_ARG_ENABLE([allunits], AS_HELP_STRING([--enable-allunits], [Include units for programs which are not detected])) 41 | 42 | if test "x$enable_allunits" = "xyes" ; then 43 | E_PROG="/usr/bin/enlightenment_start" 44 | XFWM_PROG="/usr/bin/xfwm4" 45 | XFCE_PROG="/usr/bin/xfce4-session" 46 | XBMC_PROG="/usr/bin/xbmc-standalone" 47 | GNOME_PROG="/usr/bin/gnome-session" 48 | MATE_PROG="/usr/bin/mate-session" 49 | KDE_PROG="/usr/bin/startkde" 50 | MYTH_PROG="/usr/bin/mythfrontend" 51 | OPENBOX_PROG="/usr/bin/openbox" 52 | STEAM_PROG="/usr/bin/steam" 53 | else 54 | AC_CHECK_PROG([E_PROG], [enlightenment_start], [`which enlightenment_start`]) 55 | AC_CHECK_PROG([XFWM_PROG], [xfwm4], [`which xfwm4`]) 56 | AC_CHECK_PROG([XFCE_PROG], [xfce4-session], [`which xfce4-session`]) 57 | AC_CHECK_PROG([XBMC_PROG], [xbmc-standalone], [`which xbmc-standalone`]) 58 | AC_CHECK_PROG([GNOME_PROG], [gnome-session], [`which gnome-session`]) 59 | AC_CHECK_PROG([MATE_PROG], [mate-session], [`which mate-session`]) 60 | AC_CHECK_PROG([KDE_PROG], [startkde], [`which startkde`]) 61 | AC_CHECK_PROG([MYTH_PROG], [mythfrontend], [`which mythfrontend`]) 62 | AC_CHECK_PROG([OPENBOX_PROG], [openbox], [`which openbox`]) 63 | AC_CHECK_PROG([STEAM_PROG], [steam], [`which steam`]) 64 | fi 65 | 66 | AM_CONDITIONAL([HAVE_E], [test -n "$E_PROG"]) 67 | AM_CONDITIONAL([HAVE_XFCE], [test -n "$XFCE_PROG"]) 68 | AM_CONDITIONAL([HAVE_XBMC], [test -n "$XBMC_PROG"]) 69 | AM_CONDITIONAL([HAVE_GNOME], [test -n "$GNOME_PROG"]) 70 | AM_CONDITIONAL([HAVE_MATE], [test -n "$MATE_PROG"]) 71 | AM_CONDITIONAL([HAVE_KDE], [test -n "$KDE_PROG"]) 72 | AM_CONDITIONAL([HAVE_MYTH], [test -n "$MYTH_PROG"]) 73 | AM_CONDITIONAL([HAVE_OPENBOX], [test -n "$OPENBOX_PROG"]) 74 | AM_CONDITIONAL([HAVE_STEAM], [test -n "$STEAM_PROG"]) 75 | 76 | AC_OUTPUT([ 77 | units/system/user-session-launch@.service 78 | units/system/systemd-stop-user-sessions.service 79 | units/user/dbus.socket 80 | units/user/dbus.service 81 | units/user/cmdline.target 82 | units/user/graphical.target 83 | units/user/display-server.target 84 | units/user/enlightenment.service 85 | units/user/xbmc.service 86 | units/user/xfce4-session.service 87 | units/user/xfwm4.service 88 | units/user/gnome-session.service 89 | units/user/mate-session.service 90 | units/user/kde.service 91 | units/user/mythfrontend.service 92 | units/user/openbox.service 93 | units/user/steam.service 94 | ]) 95 | -------------------------------------------------------------------------------- /patches/dbus-fix-sba-for-dbus-activation.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dbus/dbus-server-unix.c b/dbus/dbus-server-unix.c 2 | index 130f66e..4fd772d 100644 3 | --- a/dbus/dbus-server-unix.c 4 | +++ b/dbus/dbus-server-unix.c 5 | @@ -149,7 +149,7 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry, 6 | } 7 | else if (strcmp (method, "systemd") == 0) 8 | { 9 | - int n, *fds; 10 | + int i, n, *fds; 11 | DBusString address; 12 | 13 | n = _dbus_listen_systemd_sockets (&fds, error); 14 | @@ -159,27 +159,39 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry, 15 | return DBUS_SERVER_LISTEN_DID_NOT_CONNECT; 16 | } 17 | 18 | - _dbus_string_init_const (&address, "systemd:"); 19 | + if (!_dbus_string_init(&address)) 20 | + goto systemd_oom; 21 | 22 | - *server_p = _dbus_server_new_for_socket (fds, n, &address, NULL); 23 | - if (*server_p == NULL) 24 | + for (i = 0; i < n; i++) 25 | { 26 | - int i; 27 | - 28 | - for (i = 0; i < n; i++) 29 | + if (i > 0) 30 | { 31 | - _dbus_close_socket (fds[i], NULL); 32 | + if (!_dbus_string_append (&address, ";")) 33 | + goto systemd_oom; 34 | } 35 | - dbus_free (fds); 36 | - 37 | - dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL); 38 | - return DBUS_SERVER_LISTEN_DID_NOT_CONNECT; 39 | + if (!_dbus_append_address_from_socket (fds[i], &address, error)) 40 | + goto systemd_err; 41 | } 42 | 43 | + *server_p = _dbus_server_new_for_socket (fds, n, &address, NULL); 44 | + if (*server_p == NULL) 45 | + goto systemd_oom; 46 | + 47 | dbus_free (fds); 48 | 49 | return DBUS_SERVER_LISTEN_OK; 50 | - } 51 | + systemd_oom: 52 | + _DBUS_SET_OOM (error); 53 | + systemd_err: 54 | + for (i = 0; i < n; i++) 55 | + { 56 | + _dbus_close_socket (fds[i], NULL); 57 | + } 58 | + dbus_free (fds); 59 | + _dbus_string_free (&address); 60 | + 61 | + return DBUS_SERVER_LISTEN_DID_NOT_CONNECT; 62 | + } 63 | #ifdef DBUS_ENABLE_LAUNCHD 64 | else if (strcmp (method, "launchd") == 0) 65 | { 66 | diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c 67 | index b4ecc96..41abc4d 100644 68 | --- a/dbus/dbus-sysdeps-unix.c 69 | +++ b/dbus/dbus-sysdeps-unix.c 70 | @@ -55,6 +55,7 @@ 71 | #include 72 | #include 73 | #include 74 | +#include 75 | 76 | #ifdef HAVE_ERRNO_H 77 | #include 78 | @@ -4160,4 +4161,71 @@ _dbus_check_setuid (void) 79 | #endif 80 | } 81 | 82 | +/** 83 | + * Read the address from the socket and append it to the string 84 | + * 85 | + * @param fd the socket 86 | + * @param address 87 | + * @param error return location for error code 88 | + */ 89 | +dbus_bool_t 90 | +_dbus_append_address_from_socket (int fd, 91 | + DBusString *address, 92 | + DBusError *error) 93 | +{ 94 | + union { 95 | + struct sockaddr sa; 96 | + struct sockaddr_storage storage; 97 | + struct sockaddr_un un; 98 | + struct sockaddr_in ipv4; 99 | + struct sockaddr_in6 ipv6; 100 | + } socket; 101 | + char hostip[INET6_ADDRSTRLEN]; 102 | + int size = sizeof(socket); 103 | + 104 | + if (getsockname(fd, &socket.sa, &size)) 105 | + goto err; 106 | + 107 | + switch (socket.sa.sa_family) 108 | + { 109 | + case AF_UNIX: 110 | + if (socket.un.sun_path[0]=='\0') 111 | + { 112 | + if (_dbus_string_append_printf (address, "unix:abstract=%s", &(socket.un.sun_path[1]))) 113 | + return TRUE; 114 | + } 115 | + else 116 | + { 117 | + if (_dbus_string_append_printf (address, "unix:path=%s", socket.un.sun_path)) 118 | + return TRUE; 119 | + } 120 | + break; 121 | + case AF_INET: 122 | + if (inet_ntop(AF_INET, &socket.ipv4.sin_addr, hostip, sizeof (hostip))) 123 | + if (_dbus_string_append_printf (address, "tcp:family=ipv4,host=%s,port=%u", 124 | + hostip, ntohs(socket.ipv4.sin_port))) 125 | + return TRUE; 126 | + break; 127 | +#ifdef AF_INET6 128 | + case AF_INET6: 129 | + if (inet_ntop(AF_INET6, &socket.ipv6.sin6_addr, hostip, sizeof (hostip))) 130 | + if (_dbus_string_append_printf (address, "tcp:family=ipv6,host=%s,port=%u", 131 | + hostip, ntohs(socket.ipv6.sin6_port))) 132 | + return TRUE; 133 | + break; 134 | +#endif 135 | + default: 136 | + dbus_set_error(error, 137 | + _dbus_error_from_errno (EINVAL), 138 | + "Failed to read address from socket: Unknown socket type."); 139 | + return FALSE; 140 | + } 141 | + err: 142 | + dbus_set_error(error, 143 | + _dbus_error_from_errno (errno), 144 | + "Failed to open socket: %s", 145 | + _dbus_strerror (errno)); 146 | + return FALSE; 147 | +} 148 | + 149 | /* tests in dbus-sysdeps-util.c */ 150 | diff --git a/dbus/dbus-sysdeps-unix.h b/dbus/dbus-sysdeps-unix.h 151 | index 9b70896..a265b33 100644 152 | --- a/dbus/dbus-sysdeps-unix.h 153 | +++ b/dbus/dbus-sysdeps-unix.h 154 | @@ -138,6 +138,10 @@ dbus_bool_t _dbus_parse_uid (const DBusString *uid_str, 155 | 156 | void _dbus_close_all (void); 157 | 158 | +dbus_bool_t _dbus_append_address_from_socket (int fd, 159 | + DBusString *address, 160 | + DBusError *error); 161 | + 162 | /** @} */ 163 | 164 | DBUS_END_DECLS 165 | -------------------------------------------------------------------------------- /src/launcher.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of user-session-units 3 | * 4 | * (C) Copyright 2013 Intel Corporation 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * as published by the Free Software Foundation; version 2 9 | * of the License. 10 | */ 11 | 12 | #define _GNU_SOURCE 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include "pam.h" 30 | 31 | static char **seats; 32 | static sd_login_monitor *mon; 33 | 34 | static void handle_sig(int signal) 35 | { 36 | close_pam_session(); 37 | 38 | if (seats) 39 | free(seats); 40 | if (mon) 41 | sd_login_monitor_unref(mon); 42 | 43 | exit(EXIT_SUCCESS); 44 | } 45 | 46 | int main(int argc, char **argv) 47 | { 48 | int fd; 49 | int ret = 0; 50 | struct pollfd fds[1]; 51 | nfds_t nfds; 52 | struct sigaction sa; 53 | char *seat = NULL; 54 | char *user = NULL; 55 | char *sep = "-"; 56 | long long int struid; 57 | char *endptr; 58 | struct passwd *pw; 59 | 60 | sigemptyset(&sa.sa_mask); 61 | sa.sa_flags = SA_RESTART; 62 | sa.sa_handler = handle_sig; 63 | 64 | if ((sigaction(SIGINT, &sa, NULL)) < 0) { 65 | perror("sigaction"); 66 | goto fail; 67 | } 68 | if ((sigaction(SIGTERM, &sa, NULL)) < 0) { 69 | perror("sigaction"); 70 | goto fail; 71 | } 72 | 73 | if (argc != 2) { 74 | fprintf(stderr, "One argument of form SEAT-UID required.\n"); 75 | goto fail; 76 | } 77 | 78 | seat = strtok(argv[1], sep); 79 | if (!seat || !strstr(seat, "seat")) { 80 | fprintf(stderr, "SEAT name is invalid.\n"); 81 | goto fail; 82 | } 83 | 84 | user = strtok(NULL, sep); 85 | if (user) { 86 | errno = 0; 87 | struid = strtoll(user, &endptr, 10); 88 | if (errno) { 89 | perror("strtol"); 90 | goto fail; 91 | } 92 | if (endptr == user) { 93 | fprintf(stderr, "No digits found in UID.\n"); 94 | goto fail; 95 | } 96 | if (*endptr != '\0') { 97 | fprintf(stderr, "Found malformed UID.\n"); 98 | goto fail; 99 | } 100 | } else { 101 | fprintf(stderr, "UID not found.\n"); 102 | goto fail; 103 | } 104 | 105 | errno = 0; 106 | pw = getpwuid((uid_t)struid); 107 | if (!pw) { 108 | if (errno) 109 | perror("getpwuid"); 110 | else 111 | fprintf(stderr, "No matching passwd entry found.\n"); 112 | goto fail; 113 | } 114 | user = pw->pw_name; 115 | 116 | /* Only monitor seats for now, since there should only 117 | * be one graphical session per seat. 118 | */ 119 | if ((sd_login_monitor_new("seat", &mon)) < 0) { 120 | perror("sd_login_monitor_new"); 121 | goto fail; 122 | } 123 | 124 | fd = sd_login_monitor_get_fd(mon); 125 | if (fd < 0) { 126 | perror("sd_login_monitor_get_fd"); 127 | goto fail; 128 | } 129 | 130 | if ((sd_get_seats(&seats)) < 0) { 131 | perror("sd_get_seats"); 132 | goto fail; 133 | } 134 | 135 | while (!seats) { 136 | /* logind has not initialized yet, so we poll() 137 | * until /run/systemd/seats gains a seat */ 138 | nfds = 1; 139 | fds[0].fd = fd; 140 | fds[0].events = POLLIN; 141 | ret = poll(fds, nfds, -1); 142 | 143 | if (ret < 0) { 144 | perror("poll"); 145 | goto fail; 146 | } 147 | 148 | if (fds[0].revents & POLLIN) { 149 | ret = sd_get_seats(&seats); 150 | if (ret < 0) { 151 | perror("sd_get_seats"); 152 | goto fail; 153 | } 154 | /* This is an unlikely scenario, but check 155 | * to be safe */ 156 | if (ret == 0 || !seats) { 157 | /* This resets the inotify fd for us */ 158 | sd_login_monitor_flush(mon); 159 | continue; 160 | } 161 | /* A seat is available; so we know logind 162 | * has initialized by now. */ 163 | break; 164 | } else { 165 | fprintf(stderr, "Unexpected poll() error\n"); 166 | goto fail; 167 | } 168 | } 169 | 170 | char **s = seats; 171 | for (; *s; s++) { 172 | if (strcmp(seat, *s) == 0) { 173 | /* The requested seat is available */ 174 | setup_pam_session(seat, user); 175 | } 176 | free(*s); 177 | } 178 | 179 | /* Be sure to not inherit root's supplemental groups */ 180 | if (initgroups(pw->pw_name, pw->pw_gid) != 0) 181 | perror("initgroups"); 182 | 183 | /* Change our gid while we're still privileged */ 184 | if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) != 0) 185 | perror("setresgid"); 186 | 187 | /* We don't need to be privileged when the session closes */ 188 | if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) != 0) 189 | perror("setresuid"); 190 | 191 | pause(); 192 | 193 | /* unreachable */ 194 | return 0; 195 | fail: 196 | if (mon) 197 | sd_login_monitor_unref(mon); 198 | 199 | return 1; 200 | } 201 | -------------------------------------------------------------------------------- /src/pam.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of user-session-units 3 | * 4 | * (C) Copyright 2013 Intel Corporation 5 | * Authors: 6 | * Auke Kok 7 | * Arjan van de Ven 8 | * Michael Meeks 9 | * 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License 12 | * as published by the Free Software Foundation; version 2 13 | * of the License. 14 | */ 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #include "pam.h" 27 | 28 | static pam_handle_t *ph; 29 | static struct pam_conv pc; 30 | 31 | /* 32 | * Sometimes PAM likes to chat with you, before it is assured 33 | * enough to let you log-in: fun. 34 | */ 35 | static int 36 | pam_conversation_fn(int msg_count, 37 | const struct pam_message **messages, 38 | struct pam_response **responses, 39 | void *user_data) 40 | { 41 | int i; 42 | (void)user_data; 43 | 44 | printf("pam conversation with %d messages", msg_count); 45 | if (responses) 46 | *responses = NULL; 47 | 48 | if (msg_count < 1) /* ping */ 49 | return PAM_SUCCESS; 50 | 51 | /* otherwise find any helpful data we can to print, and bail */ 52 | if (!responses || !messages) { 53 | printf("pam conversation with no message, or response"); 54 | return PAM_CONV_ERR; 55 | } 56 | *responses = calloc ((size_t)msg_count, sizeof (struct pam_response)); 57 | for (i = 0; i < msg_count; i++) { 58 | const struct pam_message *msg = messages[i]; 59 | 60 | if (msg->msg_style == PAM_TEXT_INFO) 61 | printf("pam chats to us: '%s'", msg->msg); 62 | else if (msg->msg_style == PAM_ERROR_MSG) 63 | printf("Error: pam error msg '%s'", msg->msg); 64 | else 65 | printf("pam message %d style %d: '%s'", 66 | i, msg->msg_style, msg->msg); 67 | (*responses)[i].resp = NULL; 68 | (*responses)[i].resp_retcode = PAM_SUCCESS; 69 | } 70 | 71 | return PAM_SUCCESS; 72 | } 73 | 74 | /* 75 | * Creating a PAM session. We need a pam "login" session so that the dbus 76 | * "at_console" logic will work correctly, as well as various /dev file 77 | * permissions. 78 | * 79 | * for at_console to work we need to set the PAM_TTY variable before we open 80 | * the session. "PAM_TTY" takes input in the form "ttyX". 81 | * 82 | * Additionally, for logind integration, set XDG_SEAT and XDG_VTNR. 83 | * pam_systemd.so may guess the variables correctly, but set them beforehand 84 | * just to be sure. 85 | */ 86 | void setup_pam_session(char *seat, char *user) 87 | { 88 | int err; 89 | 90 | pc.conv = pam_conversation_fn; 91 | pc.appdata_ptr = NULL; 92 | 93 | err = pam_start("login", user, &pc, &ph); 94 | 95 | /* FIXME: do not hardcode the tty here; should check 96 | * first to see if it's already taken. */ 97 | err = pam_set_item(ph, PAM_TTY, "tty1"); 98 | if (err != PAM_SUCCESS) { 99 | printf("pam_set_item PAM_TTY returned %d: %s\n", err, pam_strerror(ph, err)); 100 | exit(EXIT_FAILURE); 101 | } 102 | 103 | err = pam_misc_setenv(ph, "XDG_SEAT", seat, 0); 104 | if (err != PAM_SUCCESS) { 105 | printf("pam_misc_setenv XDG_SEAT returned %d: %s\n", err, pam_strerror(ph, err)); 106 | exit(EXIT_FAILURE); 107 | } 108 | 109 | /* FIXME: this variable should correspond to PAM_TTY */ 110 | err = pam_misc_setenv(ph, "XDG_VTNR", "1", 0); 111 | if (err != PAM_SUCCESS) { 112 | printf("pam_misc_setenv XDG_VTNR returned %d: %s\n", err, pam_strerror(ph, err)); 113 | exit(EXIT_FAILURE); 114 | } 115 | 116 | err = pam_open_session(ph, 0); 117 | if (err != PAM_SUCCESS) { 118 | printf("pam_open_session returned %d: %s\n", err, pam_strerror(ph, err)); 119 | exit(EXIT_FAILURE); 120 | } 121 | } 122 | 123 | void close_pam_session(void) 124 | { 125 | int err; 126 | 127 | err = pam_close_session(ph, 0); 128 | if (err) 129 | printf("pam_close_session returned %d: %s\n", err, pam_strerror(ph, err)); 130 | pam_end(ph, err); 131 | } 132 | -------------------------------------------------------------------------------- /src/pam.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of user-session-units 3 | * 4 | * (C) Copyright 2013 Intel Corporation 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * as published by the Free Software Foundation; version 2 9 | * of the License. 10 | */ 11 | 12 | #ifndef __PAM_H__ 13 | #define __PAM_H__ 14 | 15 | void setup_pam_session(char *seat, char *user); 16 | void close_pam_session(void); 17 | 18 | #endif /* __PAM_H_ */ 19 | -------------------------------------------------------------------------------- /units/system/systemd-stop-user-sessions.service.in: -------------------------------------------------------------------------------- 1 | # This file is part of systemd. 2 | # 3 | # systemd is free software; you can redistribute it and/or modify it 4 | # under the terms of the GNU Lesser General Public License as published by 5 | # the Free Software Foundation; either version 2.1 of the License, or 6 | # (at your option) any later version. 7 | 8 | [Unit] 9 | Description=Disable User Sessions 10 | Documentation=man:systemd-user-sessions.service(8) 11 | Before=shutdown.target 12 | DefaultDependencies=no 13 | 14 | [Service] 15 | Type=oneshot 16 | RemainAfterExit=yes 17 | ExecStart=@SYSTEMDUTILDIR@/systemd-user-sessions stop 18 | 19 | [Install] 20 | WantedBy=shutdown.target 21 | -------------------------------------------------------------------------------- /units/system/user-session-launch@.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=User Session Launcher 3 | After=systemd-user-sessions.service systemd-logind.service 4 | Requires=systemd-logind.service 5 | 6 | [Service] 7 | ExecStart=/usr/bin/user-session-launch %i 8 | 9 | [Install] 10 | WantedBy=graphical.target 11 | -------------------------------------------------------------------------------- /units/user/cmdline.target.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=Non-graphical services 4 | Wants=xorg.target 5 | Requires=dbus.socket 6 | After=xorg.target dbus.socket 7 | 8 | [Install] 9 | Alias=default.target 10 | -------------------------------------------------------------------------------- /units/user/dbus.service.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=D-Bus System Message Bus 4 | Requires=dbus.socket 5 | 6 | [Service] 7 | ExecStart=@DBUSDAEMONDIR@/dbus-daemon --session --address=systemd: --nofork --systemd-activation 8 | ExecReload=@DBUSPREFIX@/bin/dbus-send --print-reply --session --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig 9 | 10 | -------------------------------------------------------------------------------- /units/user/dbus.socket.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=D-Bus System Message Bus Socket 3 | 4 | [Socket] 5 | ListenStream=%t/dbus/user_bus_socket 6 | -------------------------------------------------------------------------------- /units/user/display-server.target.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=Display server 4 | 5 | # We'll hardcode xorg for now, but in the future we'll probably want to remove 6 | # this so Wayland and other display servers can be used instead. 7 | Wants=xorg.target 8 | After=xorg.target 9 | -------------------------------------------------------------------------------- /units/user/enlightenment.service.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=The enlightenment Window Manager 4 | Requires=xorg.target 5 | After=xorg.target 6 | 7 | [Service] 8 | ExecStart=@E_PROG@ 9 | Restart=on-failure 10 | 11 | [Install] 12 | Alias=window-manager.service 13 | -------------------------------------------------------------------------------- /units/user/gnome-session.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=The GNOME session manager 3 | Requires=display-server.target 4 | After=display-server.target 5 | 6 | [Service] 7 | ExecStart=@GNOME_PROG@ 8 | Restart=on-failure 9 | 10 | [Install] 11 | Alias=session-manager.service 12 | -------------------------------------------------------------------------------- /units/user/graphical.target.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=Graphical desktop 4 | Wants=window-manager.service session-manager.service 5 | Requires=cmdline.target display-server.target 6 | After=cmdline.target display-server.target window-manager.service session-manager.service 7 | AllowIsolate=true 8 | 9 | [Install] 10 | Alias=default.target 11 | -------------------------------------------------------------------------------- /units/user/kde.service.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=The KDE start agent 4 | Requires=display-server.target 5 | After=display-server.target 6 | 7 | [Service] 8 | ExecStart=@KDE_PROG@ 9 | Restart=on-failure 10 | 11 | [Install] 12 | Alias=session-manager.service 13 | -------------------------------------------------------------------------------- /units/user/mate-session.service.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=The MATE session manager 4 | Requires=xorg.target 5 | After=xorg.target 6 | 7 | [Service] 8 | ExecStart=@MATE_PROG@ 9 | Restart=on-failure 10 | 11 | [Install] 12 | Alias=session-manager.service 13 | -------------------------------------------------------------------------------- /units/user/mythfrontend.service.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=MythTV Frontend 4 | Requires=display-server.target 5 | After=display-server.target 6 | 7 | [Service] 8 | Environment=PATH=/bin:/usr/bin:/sbin:/usr/sbin 9 | ExecStart=@MYTH_PROG@ 10 | Restart=on-failure 11 | 12 | [Install] 13 | WantedBy=graphical.target 14 | 15 | -------------------------------------------------------------------------------- /units/user/openbox.service.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=The Openbox Window Manager 4 | Requires=xorg.target 5 | After=xorg.target 6 | 7 | [Service] 8 | ExecStart=@OPENBOX_PROG@ 9 | Restart=on-failure 10 | 11 | [Install] 12 | Alias=window-manager.service 13 | -------------------------------------------------------------------------------- /units/user/steam.service.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=Steam - Big Picture mode 4 | Requires=display-server.target 5 | After=display-server.target 6 | 7 | [Service] 8 | ExecStart=@STEAM_PROG@ steam://open/bigpicture 9 | Restart=on-failure 10 | 11 | [Install] 12 | WantedBy=graphical.target 13 | -------------------------------------------------------------------------------- /units/user/xbmc.service.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=XBMC 4 | Requires=display-server.target 5 | After=display-server.target 6 | 7 | [Service] 8 | Environment=PATH=/bin:/usr/bin:/sbin:/usr/sbin 9 | ExecStart=@XBMC_PROG@ 10 | Restart=on-failure 11 | 12 | [Install] 13 | WantedBy=graphical.target 14 | -------------------------------------------------------------------------------- /units/user/xfce4-session.service.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=Xfce4 Session Manager 4 | Requires=display-server.target 5 | After=display-server.target 6 | 7 | [Service] 8 | ExecStart=@XFCE_PROG@ 9 | Restart=on-failure 10 | 11 | [Install] 12 | Alias=session-manager.service 13 | 14 | -------------------------------------------------------------------------------- /units/user/xfwm4.service.in: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=Xfce Window Manager Daemon 4 | Requires=xorg.target 5 | After=xorg.target 6 | 7 | [Service] 8 | ExecStart=@XFWM_PROG@ 9 | Restart=on-failure 10 | 11 | [Install] 12 | Alias=window-manager.service 13 | --------------------------------------------------------------------------------