diff --git a/doc/66-tree.md b/doc/66-tree.md index a4099d14fbaa9f0d9e37be0d81fb8c5a08999a15..ee64ac928516b477cd12817406159a5beb6ae01f 100644 --- a/doc/66-tree.md +++ b/doc/66-tree.md @@ -14,7 +14,7 @@ This command handles a directory containing a set of *services*. ## Interface ``` - 66-tree [ -h ] [ -z ] [ -v verbosity ] [ -l ] [ -n|R ] [ -a|d ] [ -c ] [ -S after_tree ] [ -E|D ] [ -C clone ] tree + 66-tree [ -h ] [ -z ] [ -v verbosity ] [ -n|R ] [ -a|d ] [ -c ] [ -S after_tree ] [ -E|D ] [ -C clone ] tree ``` *66-tree* will create, destroy, or modify a tree which dynamically handles *services*. *66-tree* will handle the tree only for the user running the process (root/user). Any *tree* is completely independent from another. If you want to know what trees are currently available on the system use the [66-intree](66-intree.html) tool. @@ -37,8 +37,6 @@ This command handles a directory containing a set of *services*. * *3* : also print tracing messages. * *4* : also print debugging messages. -- **-l** *live* : changes the supervision directory of *service* to *live*. By default this will be `%%livedir%%`. The default can also be changed at compile time by passing the `--livedir=live` option to `./configure`. An existing absolute path is expected and should be within a writable and executable filesystem - likely a RAM filesystem—see [66-scandir](66-scandir.html). - - **-n** : creates a new empty *tree*. The new *tree* ***must*** not exist on the system. - **-a** *user* : allows *user* to configure the given *tree*. ***Must*** match an existing username on the system. Several users can be allowed by separating their names with a comma. Any *user* not explicitly allowed is automatically denied for configuring the given *tree*. By default the *user* issuing the command is automatically allowed when the tree is created.—This option sets the UID and GID of the service database at compilation time. @@ -67,7 +65,7 @@ The usefulness of having several trees with different services can be explained Tree3 contains xorg, notification-daemon, gvfsd & dbus ``` -When you boot your machine and want to use it from console only, you don't care about xorg or cups, you only care about a working internet connection. So at the base you only have Tree1 enabled. At every boot this tree and all its services will now be automatically started. Then you need to print something but for this, you also need to start the nfs daemon because your document is on another server. Normally you would need to start cups then star nfs. Using the concept of trees you start Tree2 and everything is available. When you have finished printing your document, instead of stopping the needed services one by one you simply stop Tree2, and all its containing services are stopped automatically. This doesn't stop here. Now you want to see a video, you need a running X server and probably several other services. Tree3 was designed just for that. +When you boot your machine and want to use it from console only, you don't care about xorg or cups, you only care about a working internet connection. So at the base you only have Tree1 enabled. At every boot this tree and all its services will now be automatically started. Then you need to print something but for this, you also need to start the nfs daemon because your document is on another server. Normally you would need to start cups then start nfs. Using the concept of trees you start Tree2 and everything is available. When you have finished printing your document, instead of stopping the needed services one by one you simply stop Tree2, and all its containing services are stopped automatically. This doesn't stop here. Now you want to see a video, you need a running X server and probably several other services. Tree3 was designed just for that. ## Directories and files diff --git a/src/66/66-tree.c b/src/66/66-tree.c index 4f2ecf9922023edb374b81c861648fa782f7dbf1..605c22570e2c9a004b99ced8528563bbe122f828 100644 --- a/src/66/66-tree.c +++ b/src/66/66-tree.c @@ -44,9 +44,8 @@ #include <s6-rc/s6rc-servicedir.h> #include <s6-rc/s6rc-constants.h> -#define USAGE "66-tree [ -h ] [ -z ] [ -v verbosity ] [ -l ] [ -n|R ] [ -a|d ] [ -c ] [ -S after_tree ] [ -E|D ] [ -C clone ] tree" +#define USAGE "66-tree [ -h ] [ -z ] [ -v verbosity ] [ -n|R ] [ -a|d ] [ -c ] [ -S after_tree ] [ -E|D ] [ -C clone ] tree" -static stralloc reslive = STRALLOC_ZERO ; static char const *cleantree = 0 ; static inline void info_help (void) @@ -59,7 +58,6 @@ static inline void info_help (void) " -h: print this help\n" " -z: use color\n" " -v: increase/decrease verbosity\n" -" -l: live directory\n" " -n: create a new empty tree\n" " -a: allow user(s) at tree\n" " -d: deny user(s) at tree\n" @@ -494,7 +492,6 @@ int main(int argc, char const *const *argv,char const *const *envp) stralloc base = STRALLOC_ZERO ; stralloc dstree = STRALLOC_ZERO ; stralloc clone = STRALLOC_ZERO ; - stralloc live = STRALLOC_ZERO ; log_color = &log_color_disable ; @@ -506,16 +503,13 @@ int main(int argc, char const *const *argv,char const *const *envp) for (;;) { - int opt = getopt_args(argc,argv, "hv:l:na:d:cS:EDRC:z", &l) ; + int opt = getopt_args(argc,argv, "hv:na:d:cS:EDRC:z", &l) ; if (opt == -1) break ; if (opt == -2) log_die(LOG_EXIT_USER,"options must be set first") ; switch (opt) { case 'h' : info_help(); return 0 ; case 'v' : if (!uint0_scan(l.arg, &VERBOSITY)) log_usage(USAGE) ; break ; - case 'l' : if (!stralloc_cats(&live,l.arg)) log_die_nomem("stralloc") ; - if (!stralloc_0(&live)) log_die_nomem("stralloc") ; - break ; case 'n' : create = 1 ; break ; case 'a' : if (!scan_uidlist_wdelim(l.arg,auids,',')) log_usage(USAGE) ; auidn = auids[0] ; @@ -549,10 +543,6 @@ int main(int argc, char const *const *argv,char const *const *envp) if (!set_ownersysdir(&base, owner)) log_dieusys(LOG_EXIT_SYS,"set owner directory") ; - r = set_livedir(&live) ; - if (!r) log_die_nomem("stralloc") ; - if(r < 0) log_dieu(LOG_EXIT_SYS,"livedir: ",live.s," must be an absolute path") ; - log_trace("sanitize ",tree,"..." ) ; r = sanitize_tree(&dstree,base.s,tree,owner) ; @@ -802,8 +792,6 @@ int main(int argc, char const *const *argv,char const *const *envp) log_info("Ordered successfully: ",tree," starts after tree: ",after_tree) ; } - stralloc_free(&reslive) ; - stralloc_free(&live) ; stralloc_free(&base) ; stralloc_free(&dstree) ; stralloc_free(&clone) ;