Commit Graph

54273 Commits

Author SHA1 Message Date
Axel Dörfler
19a4ba1015 launch_daemon: Now blocks the CD tray on read-only /boot. 2015-07-22 20:44:21 +02:00
Axel Dörfler
634aefe4fd launch_daemon: Now supports getting the env from a script.
* Scripts from targets are evaluated once on first target launch,
  scripts from jobs are evaluated on each start.
* The "desktop" target now sources SetupEnvironment as usual.
2015-07-22 20:44:16 +02:00
Axel Dörfler
463d38e40b Fixed exec*(), and __flatten_process_args() with NULL env.
* Not sure if it's following any standard, but environ can be NULL
  (either by manually setting it to NULL, or by calling clearenv()).
2015-07-22 20:44:12 +02:00
Axel Dörfler
ea19a80ed6 launch_daemon: Added support for setting env.
* We cannot "source" files through a shell yet, though.
2015-07-22 20:44:07 +02:00
Axel Dörfler
fb7dad2b49 BRoster: Added ability to pass env on launch.
* Added BRoster::Private::Launch() that adds an additional parameter
  to pass a pointer to the environment of the launched app.
2015-07-22 20:44:03 +02:00
Axel Dörfler
06e0f8079f registrar: Fixed app_server detection.
* This also fixes the shutdown process, as the registrar no longer
  kills the app_server.
* Removed SERVER_PORT_NAME definition as it has no use anymore.
2015-07-22 20:43:58 +02:00
Axel Dörfler
05a567f609 Added autologin command, and use it by default.
* This will handle our current single-user login needs.
* Removed Login from the minimum image again.
2015-07-22 20:43:54 +02:00
Axel Dörfler
1281fcd3cb launch_daemon: Improved job overwriting.
* Certain things are set on job construction only.
* Now checks if the message has the field before updating it.
* Might not be final yet (it is confusing that 'requires' will add to
  the requirements, but 'launch' will replace all arguments).
2015-07-22 20:43:49 +02:00
Axel Dörfler
4c67f79c2c FirstBootPrompt: launch installer/desktop targets directly.
* No need for shell scripting here.
2015-07-22 20:43:44 +02:00
Axel Dörfler
bd1c9bf338 launch_daemon: Set some HOME/LC_TYPE defaults. 2015-07-22 20:43:40 +02:00
Axel Dörfler
a3211522d9 launch_daemon: Fixed registering session daemon.
* Still used the old protocol.
* Minor cleanup.
2015-07-22 20:43:35 +02:00
Axel Dörfler
638ee09556 data/launch/user: Fixed FirstBootPrompt location.
* Now started via signature (it lives in bin, not apps).
2015-07-22 20:43:30 +02:00
Axel Dörfler
7987907008 launch_daemon: We can now talk to the authentication manager.
* When creating the port of the registrar's authentication manager, we
  now set it manually, so that the user/group functions work.
* This allows LaunchDaemon::_StartSession() to set up the user, and
  groups as needed.
2015-07-22 20:43:26 +02:00
Axel Dörfler
560119c9a4 launch_daemon: Don't verify passwords.
* Instead, the caller should have done this already. This is really
  outside of the scope of the launch_daemon.
* Fixed Login with empty passwords; removed the (unused) test login
  feature along the way.
2015-07-22 20:43:22 +02:00
Axel Dörfler
cb82874e92 multiuser_utils: Fixed verifying empty password.
* verify_password() would accept all passwords if the there was
  none set, instead of accepting only an empty password.
2015-07-22 20:43:17 +02:00
Axel Dörfler
e0fc09b439 launch_daemon: Conditions now know if they are constant.
* This allows to remove a job in the init phase already, if its
  condition is not only constant, but also failing.
* Also removed the special Job::LaunchInSafeMode() method; this is now
  done using the conditions (the config option no_safemode remains,
  though).
2015-07-22 20:43:13 +02:00
Axel Dörfler
004cd6709d launch_daemon: Added run directive.
* Allows to conditionally (or unconditionally) launch targets.
* Including tests for the settings parser.
* FirstBootPrompt is now launched when deemed necessary (as in
  the Bootscript).
2015-07-22 20:43:08 +02:00
Axel Dörfler
d91addd24c launch_daemon: Added Condition::ToString() method.
* For debugging purposes only.
2015-07-22 20:43:03 +02:00
Axel Dörfler
cefd7c496d Sudoku: Improved value hint.
* Removed toggling its visibility on click - it's now always visible
  once it's there.
* Also update and show it when changing a value or hint.
2015-07-22 20:42:59 +02:00
Axel Dörfler
0e347cb203 launch_daemon: Added condition tests. 2015-07-22 20:42:54 +02:00
Axel Dörfler
17ac467a6e launch_daemon: Actually set the conditions. 2015-07-22 20:42:50 +02:00
Axel Dörfler
c2d703ea5d launch_daemon: Make sure conditions are properly deleted. 2015-07-22 20:42:45 +02:00
Axel Dörfler
1e9c987102 launch_daemon: Added basic support for conditions.
* Admittedly not very well thought out, but it should be good
  enough for now; it doesn't really make sense to initialize jobs
  that is never run due to failed conditions.
* Job, and Target now have a common base class BaseJob that deals
  with the conditions.
2015-07-22 20:42:41 +02:00
Axel Dörfler
f7cf381a14 launch_daemon: Completed condition parser. 2015-07-22 20:42:36 +02:00
Axel Dörfler
e73c936699 launch_daemon: Started working on condition parsing.
* Moved related test code from DriverSettingsMessageAdapterTest to the
  SettingsParser class.
* Added SettingsParserTest class -- most tests already succeed, but not
  all; support for the flattened "not" is not working yet.
2015-07-22 20:42:32 +02:00
Axel Dörfler
68a3c0f919 launch_daemon: Moved settings parsing into its own file. 2015-07-22 20:42:27 +02:00
Axel Dörfler
c4b6278c02 DriverSettingsMessageAdapter: added "wildcard" support.
* You can now add arbitrarily named fields to the message as well,
  without having them all specified in the template.
* Also added a missing converter method that is called when there
  are no values to add, and implemented all methods in the base
  class, so that you only have to implement the methods you actually
  need.
2015-07-22 20:42:22 +02:00
Axel Dörfler
e51a20af4f launch_daemon: Fixed operator precedence bug.
* Found by GCC 4.
2015-07-22 20:42:18 +02:00
Axel Dörfler
78e39852fa launch_daemon: Use BRoster::Launch() without registrar.
* BRoster now allows settings a "no-registrar" mode that is currently
  only honored in _LaunchApp(), though.
* Job::Launch() is now using this, which also allows launching
  applications by signature (ie. if the job name matches the
  signature, you can omit the "launch" option).
2015-07-22 20:42:13 +02:00
Axel Dörfler
1f9826a778 BRoster: minor cleanup. 2015-07-22 20:42:09 +02:00
Axel Dörfler
234f76a19c launch_daemon: log failed launch jobs. 2015-07-22 20:42:04 +02:00
Axel Dörfler
70d9734f25 Login.rdef: fixed copy&paste bug; it's not Tracker. 2015-07-22 20:42:00 +02:00
Axel Dörfler
8b8780bfe3 launch_daemon: Moved Job+Target into separate files. 2015-07-22 20:41:55 +02:00
Axel Dörfler
c086a1834b launch_daemon: Improved target support.
* You can now put jobs/services into a target.
* Instead of having Login started as part of the normal boot process,
  it's now in the "login" target.
* The app_server now launches the login target when a login becomes
  available (ie. during startup, but that could be improved later on).
2015-07-22 20:41:51 +02:00
Axel Dörfler
a44d3faf2e Sudoku: Don't switch workspace for progress window. 2015-07-22 20:41:46 +02:00
Axel Dörfler
c7c1744b2e JobQueue::AddJob() returns error on lock failure.
* If the lock could not be obtained, it will now return B_ERROR
  instead of B_OK.
2015-07-22 20:41:41 +02:00
Axel Dörfler
ac0a462fba launch_daemon: Basic user session implementation.
* Instead of launching Tracker/Deskbar directly, we now launch the
  Login application.
* This will now start a new session for the selected user (the password
  is currently ignored).
* When a user session is started, the launch_daemon forks, and the
  child then restarts the LaunchDaemon application in user mode.
* It then registers itself with its parent, in order to resolve user
  dependent services.
* Added a user launch file that will cause Tracker, and Deskbar to
  start in the new session.
2015-07-22 20:41:37 +02:00
Axel Dörfler
9cc27f7369 launch_daemon: Merged Job with LaunchJob, cyclic dependencies.
* Job is now a BJob, and includes the former LaunchJob functionality.
* Dependencies are now resolved on init, and jobs are removed early
  when they are not met (or are cyclic, which is now also detected).
2015-07-22 20:41:32 +02:00
Axel Dörfler
0337b4adfd launch_daemon: Moved (Main)Worker to its own file. 2015-07-22 20:41:28 +02:00
Axel Dörfler
f913a08780 launch_daemon: Added basic dependency support.
* Untested, and even incomplete, though.
2015-07-22 20:41:23 +02:00
Axel Dörfler
f4e75e7c37 launch_daemon: use BJobs for everything, multi-threaded worker.
* Implemented a multi-threaded job queue, that launches as many as CPU
  count jobs at once -- due to SSDs, this number could possibly even be
  made much larger, though.
* Launching a job now happens within that worker queues as a LaunchJob.
* Put all init jobs into an init target, and make the launch jobs depend
  on it.
2015-07-22 20:41:19 +02:00
Axel Dörfler
c16361c49c launch_daemon: Initialize /tmp & /var/shared_memory, clock.
* Added initializing /tmp & /var/shared_memory to the launch_daemon.
* Moved clockconfig.cpp code into the launch_daemon.
* This follows systemd design; since those jobs are fixed, it doesn't
  matter where you maintain them.
* The init jobs are BJobs, but the JobQueue is only used for that
  one use for now. At a later time, I intend to put the job launching
  in there, as well. BJob allows to represent the dependencies already.
2015-07-22 20:41:14 +02:00
Axel Dörfler
ef462ab57f libroot: ensure that the launch_daemon doesn't wait for itself.
* The launch_daemon might indirectly call get_launch_daemon_port()
  which may cause a deadlock. Just fail in this case.
2015-07-22 20:41:09 +02:00
Axel Dörfler
1f374c8b2a libroot: hardcode find_directory() to /home/boot for root.
* This is a work-around to allow the registrar, and the launch_daemon
  to call find_directory() without worries.
2015-07-22 20:41:05 +02:00
Axel Dörfler
bea38cb711 registrar: implemented auth port via launch_daemon.
* get_roster_port_name() is no longer needed.
* This also removes the app_server restart code from the debug
  server -- this will be done by the launch_daemon in the future.
2015-07-22 20:41:01 +02:00
Axel Dörfler
7ef0edec04 syslog_daemon: don't delete the port on quit.
* It belongs to the launch daemon.
2015-07-22 20:40:56 +02:00
Axel Dörfler
798ad3db30 BLooper: don't delete a launch_daemon port.
* Unless the service is really to be quit, the port should stay around;
  but that decision is to be made by the launch_daemon, not the service
  itself.
2015-07-22 20:40:52 +02:00
Axel Dörfler
4bf862e368 syslog_daemon: Converted to BServer.
* Instead of letting the kernel search for the syslog port, the
  daemon now registers itself with the kernel (which even solves
  a TODO).
* A port is created for the actual log messages from the launch_daemon,
  and used on start.
* However, the SyslogTest does not yet work, due to the BMessage <->
  KMessage communication problems.
2015-07-22 20:40:47 +02:00
Axel Dörfler
9d69dc097d libroot: added ability to communicate with the launch_daemon.
* These methods don't really work yet, as BMessage doesn't support
  replying with a KMessage; the request is received, but the reply
  never gets to the target.
2015-07-22 20:40:42 +02:00
Axel Dörfler
43aec2c726 launch_daemon: added support for arbitrary ports.
* Dropped "create_port" -- this is now the default for services.
* Additionally (or alternatively, if you use the "legacy" mode), you can
  now create named ports, and specify their capacity.
* Added convenience methods to BLaunchRoster that automatically use the
  signature of the current be_app.
2015-07-22 20:40:38 +02:00