====== Boot-up actions ====== Boot-up actions is a feature designed to let you keep //persistent// processes on the shared server, i.e. processes that launch as soon as a server boots up, and do not (ever) stop - unless an entire server goes down. This is similar to an @reboot cron job. There are many such processes running on a hosting server (e.g. the shared Apache, MySQL or Postfix services), and the boot-up actions feature in Virtualmin lets you have your own. This is typically used for web framework deployment - e.g. **Mongrel** (for Rails) or **Lighttpd** (for Django and others) - or specific applications (e.g. the **Tracd** daemon for Trac sites). We are providing several templates for popular services (but you can create any custom job). Sun Solaris' own Service Management Facility (SMF) service is under the hood, which not only starts the process when the server boots, but also monitors it constantly and will always report its status to you through the boot-up actions module interface in Virtualmin, letting you stop or restart the process if needed. The boot-up actions service can be found when you login to Virtualmin (see [[logins]]) and select the respective virtual server from the list (actions are managed on a per-virtual server basis), click **Services** then **Bootup Actions**. If you want a list of all actions defined on your entire account, switch your left navigation pane to **Webmin**, then click **System** and **Virtualmin Bootup Actions**. ===== Creating a template action ===== See the particular knowledge base pages on * [[rails-with-mongrel|Mongrel]] * [[rails-with-lighttpd|Lighttpd]] * [[running-tracd|Tracd]] ===== Creating a custom action ===== - Sign in to Virtualmin (see [[Logins]]). - Click **Service** in the left-hand navigation, then click **Bootup Actions** - From the top of boot-up actions page, click **Add a new bootup action**. - Enter a short name (letters, digits, '-' or '_' are allowed, but not spaces) into the **Action name** field. - Enter a description into **Description**. - Choose whether you want the action to start (and keep running) right away using the **Started?** option. You'll most likely want to leave this as **Yes** - Enter the command to start the action into **Commands to run at startup** field. This can be a path to a binary or to a script with optional parameters etc. - Enter the command to stop the action into **Commands to run on shutdown** field, or leave at the default //Kill all started processes// option. - Click **Create**. ===== Checking the status of an action ===== Look up the action in the list and check the **Started?** column. If it says //Yes//, it means that the SMF service considers the action as 'healthy' and there is a valid process running for the service. Click the action name and you should see the process ID and stats under **Started processes**. If the status is //Failed//, click the action's name and inspect the output under **Recent log messages**. There may or may not be a clue, depending on how well the particular process talks to the system. Typical reasons may include a syntax error in your start command, missing files/directories, or an occupied port (e.g. in case you forgot about boot-up actions and started your process manually). If the output doesn't help you, follow the article on [[check-processes|checking your running processes]] to see if the process might already be running //outside// of the managed boot-up actions service. ===== Controlling an action ===== To start, stop or restart action(s), select the action(s) in the list by checking its or their checkbox, and click on **Start Selected**, **Stop Selected** or **Restart Selected** respectively. ===== Editing an action ===== Click the name of an action to see the editing options. You can change the action's name, description, and startup and shutdown commands. In most situations, the service will have to be stopped and re-created using the new data, so there might a short (up to several seconds) disruption in service. ===== Removing an action ===== Select the action(s) by checking its/their checkbox and click **Delete Selected**. The process(es) running as part of the action will be killed and the action definition will be lost.