launch_daemon: Added /system/data/user_launch directory.

* This directory is for services that are launched per user (in a user
  context), but installed globally.
* This is now used for the default "user" configuration; before this was
  put into ~/config/non-packaged/data/launch, which didn't really fit,
  and has the huge disadvantage that it cannot be updated.
* Fixes part of #12227.
This commit is contained in:
Axel Dörfler 2015-07-24 17:25:13 +02:00
parent 4a99aae9e4
commit 5e541a6042
3 changed files with 18 additions and 4 deletions

View File

@ -277,10 +277,6 @@ SEARCH on $(networkSettingsFiles)
= [ FDirName $(HAIKU_TOP) data settings network ] ;
AddFilesToHaikuImage system settings network : $(networkSettingsFiles) ;
local userLaunchScripts = <data!launch>user ;
SEARCH on $(userLaunchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
AddFilesToHaikuImage home config non-packaged data launch : $(userLaunchScripts) ;
# fresh install indicator file for the post install scripts
SEARCH on <post-install>fresh_install
= [ FDirName $(HAIKU_TOP) data system settings ] ;

View File

@ -132,6 +132,10 @@ local launchScripts = <data!launch>system ;
SEARCH on $(launchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
AddFilesToPackage data launch : $(launchScripts) ;
local userLaunchScripts = <data!launch>user ;
SEARCH on $(userLaunchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
AddFilesToPackage data user_launch : $(userLaunchScripts) ;
# post install scripts
local postInstallFiles = add_catalog_entry_attributes.sh
default_deskbar_items.sh ;

View File

@ -50,6 +50,7 @@ using BSupportKit::BPrivate::JobQueue;
static const char* kLaunchDirectory = "launch";
static const char* kUserLaunchDirectory = "user_launch";
class Session {
@ -353,10 +354,23 @@ LaunchDaemon::ReadyToRun()
_InitSystem();
BStringList paths;
if (fUserMode) {
// System-wide user specific jobs
BPathFinder::FindPaths(B_FIND_PATH_DATA_DIRECTORY, kUserLaunchDirectory,
B_FIND_PATHS_SYSTEM_ONLY, paths);
_ReadPaths(paths);
}
BPathFinder::FindPaths(B_FIND_PATH_DATA_DIRECTORY, kLaunchDirectory,
fUserMode ? B_FIND_PATHS_USER_ONLY : B_FIND_PATHS_SYSTEM_ONLY, paths);
_ReadPaths(paths);
if (fUserMode) {
BPathFinder::FindPaths(B_FIND_PATH_SETTINGS_DIRECTORY,
kUserLaunchDirectory, B_FIND_PATHS_SYSTEM_ONLY, paths);
_ReadPaths(paths);
}
BPathFinder::FindPaths(B_FIND_PATH_SETTINGS_DIRECTORY, kLaunchDirectory,
fUserMode ? B_FIND_PATHS_USER_ONLY : B_FIND_PATHS_SYSTEM_ONLY, paths);
_ReadPaths(paths);