diff --git a/software/helloworld/instance.cfg.in b/software/helloworld/instance.cfg.in index 4c46c0639548dfc094d479106e306f6d88162f55..411fe97c23e6c450db0ec624fb3a987da3732b65 100644 --- a/software/helloworld/instance.cfg.in +++ b/software/helloworld/instance.cfg.in @@ -45,7 +45,9 @@ configuration.name = John Doe # Create all needed directories, depending on your needs [directory] recipe = slapos.cookbook:mkdirectory -etc = $${buildout:directory}/etc +home = $${buildout:directory} +etc = $${:home}/etc +var = $${:home}/var # Executables put here will be started but not monitored (for startup scripts) script = $${:etc}/run/ # Executables put here will be started and monitored (for daemons) @@ -53,7 +55,8 @@ service = $${:etc}/service # Executables put here will be launched after buildout has completed to see # if instance is running promise = $${:etc}/promise/ - +# Path of the log directory used by our service (see [hello-world]) +log = $${:var}/log # Create a simple shell script that will only output your name if you # specified it as instance parameter. @@ -62,9 +65,11 @@ promise = $${:etc}/promise/ # This recipe will try to "exec" the command-line after separating parameters. recipe = slapos.cookbook:wrapper # Notice that there is only one $ at ${dash:location}, it is because it comes from the Software Release buildout profile. -command-line = ${dash:location}/bin/dash -c 'echo "Hello $${instance-parameter:configuration.name}!"; sleep 100000;' +command-line = ${dash:location}/bin/dash -c 'echo "Hello $${instance-parameter:configuration.name}, it is $(date)." > $${directory:log}/log.log; sleep 1000000;' # Put this shell script in the "etc/service" directory. Every executable of this -# repository will be started and monitored by supervisord +# repository will be started and monitored by supervisord. If one service +# exits/crashes, it will trigger a "bang" and cause run of slapgrid for the +# instance. wrapper-path = $${directory:service}/hello-world diff --git a/software/helloworld/software.cfg b/software/helloworld/software.cfg index dd05d4a158bf7e963d99d5c631888099441dc236..9bbce0b6c8c173cd209c8db7cd0d92e8e1f1062c 100644 --- a/software/helloworld/software.cfg +++ b/software/helloworld/software.cfg @@ -26,5 +26,5 @@ recipe = slapos.recipe.template url = ${:_profile_base_location_}/instance.cfg.in output = ${buildout:directory}/instance.cfg # MD5 checksum can be skipped for development (easier to develop), but must be filled for production -md5sum = 1fc461c00e86485bee77a942f39e3c43 +md5sum = ed94ac99ae1e596c0da5350da6ab6f52 mode = 0644