Sympa Logo
Translations of this page:

Automating startup

Init script

The make install step should have installed a sysV init script in your /etc/rc.d/init.d/ directory (you can change this at configure time with the --with-initdir option).

You should edit your runlevels to make sure Sympa starts after HTTP daemon (Apache, nginx, ...) and database server (MySQL, ...). Note that database server should also start before HTTP server because of wwsympa.fcgi.

Systemd units

Provided by Sympa 6.2.15 or later.

Unit files may also be installed, if your system supports Systemd. To do it, specify --with-unitsdir=<system units directory> option at configure time. You might also want to specify --without-initdir option.

Units should be customized to ensure Sympa starts after database server (if you runs it except SQLite on the same host as Sympa). It can be done by creating a configuration file, e.g. /etc/systemd/system/sympa.service.d/custom.conf, with content such as:

  [Unit]

  # For MariaDB:
  Requires=mariadb.service
  After=mariadb.service

  # For MySQL:
  Requires=mysql.service
  After=mysql.service

  # For PostgreSQL:
  Requires=postgresql.service
  After=postgresql.service

Note that path to configuration file and name of database unit can vary by distribution: Check documentation on your system. Note again that database server should also start before HTTP server because of wwsympa.fcgi.

Some systems place PID directory (e.g. /var/run) on volatile file system. You might want to recreate PID directory for Sympa (e.g. /var/run/sympa chosen by --with-piddir option at configure time) at bootup time.

Daemons overview

Init script or units starts these daemons:

  • sympa_msg.pl
  • bulk.pl
  • archived.pl
  • bounced.pl
  • task_manager.pl

To know details on them, check manual pages.

sympa_msg.pl is the main daemon; it processes mail commands and is in charge of messages distribution. sympa_msg.pl recognizes the following command line arguments:

  • --config config_file | -f config_file
    Forces Sympa to use an alternative configuration file. The default behavior is to use the configuration file as defined in the Makefile ($CONFIG).
  • --debug | -d
    Sets Sympa in debug mode and keeps it attached to the terminal. Debugging information is output to STDERR, along with standard log information. Each function call is traced. Useful while reporting a bug.
  • --foreground
    the process remains attached to the TTY
  • --keepcopy recipient_directory | -k recipient_directory
    Tells Sympa to keep a copy of every incoming message instead of deleting them. recipient_directory is the directory to store messages.
  • --mail | -m
    Sympa will log calls to sendmail, including recipients. Useful to keep track of each mail sent (log files may grow faster though).
  • --service process_command | process_message | process_creation
    Sets Sympa daemon to process only message distribution (process_message) or only commands (process_command) or list creation requests (process_creation). This option was deprecated.
  • --help | -h
    Prints sympa_msg.pl usage.
  • --version | -v
    Prints current version of Sympa.

Stopping Sympa and signals

kill -TERM

When this signal is sent to a daemon (kill -TERM), the daemon is stopped ending process in progress (message distribution, running task and so on), and this can be long (for big lists). If kill -KILL is used, daemon will stop immediately whatever a process is in progress. In this case, when the daemon restarts, messages will be distributed many times.

kill -HUP

When this signal is sent to sympa_msg.pl (kill -HUP), it switches off the –mail logging option and continues current task.

sympa.pl

As of Sympa 6.2, sympa.pl was split into three programs: sympa.pl commandline utility, sympa_msg.pl daemon and sympa_automatic.pl daemon.

sympa.pl is command line utility. sympa.pl recognizes the following command line arguments:

  • --add_list familyname --robot robotname --input_file /path/to/list_file.xml
    Adds the list described in the XML file to the familyname family. See: Adding a list to a list family.
  • --change_user_email familyname --current_email=xx --new_email=yy
    (introduced in Sympa 6.2) changes a user email address in all lists (membership and ownership) of all virtual robots.
    * --close_family familyname --robot robotname
    Closes the familyname family. See: List family closure.
  • --close_list listname@robot
    Closes the list (changing its status to closed), removes aliases (if sendmail_aliases parameter was set) and removes subscribers from DB (a dump is created in the list directory to allow the list restoration). When you are in a family context, refer to: List family closure.
  • --close_unknown
    When instanciating a family, this option tells Sympa to silently close lists unknown to the family.
  • --config config_file | -f config_file
    Forces Sympa to use an alternative configuration file. The default behavior is to use the configuration file as defined in the Makefile ($CONFIG).
  • --create_list --robot robotname --input_file /path/to/list_file.xml
    Creates the list described by the xml file, see: List creation on command line with sympa.pl.
  • --rename_list=oldlist@domain --new_listname=newlistname --new_listrobot=newrobot
    Renames list oldlist@domain to newlistname, or moves it to another robot if --new_listrobot option was different from the current robot.
  • --debug | -d
    Sets Sympa in debug mode and keeps it attached to the terminal. Debugging information is output to STDERR, along with standard log information. Each function call is traced. Useful while reporting a bug.
  • --dump listname | ALL
    Dumps subscribers, either of the list listname or of all lists. Subscribers are dumped in subscribers.db.dump.
  • --help | -h
    Prints sympa.pl usage.
  • --import listname
    Imports subscribers in the listname list. Data are read from STDIN.
  • --instantiate_family familyname --robot robotname --input_file /path/to/family_file.xml
    Instantiates the family familyname. See Lists families.
  • --lang catalog | -l catalog
    Set this option to use a language catalog for Sympa. The corresponding catalog file must be located in ~sympa/locale directory.
  • --lowercase
    Lowercases e-mail addresses in database.
  • --mail | -m
    Sympa will log calls to sendmail, including recipients. Useful to keep track of each mail sent (log files may grow faster though).
  • --make_alias_file
    Creates an aliases file in /tmp/ with all list aliases (only lists whose status is 'open'). It uses the list_aliases.tt2 template.
  • --modify_list familyname --robot robotname --input_file /path/to/list_file.xml
    Modifies the existing family list, with description contained in the XML file. See: Modifying a family list.
  • --quiet
    When instanciating a family, this option tells Sympa to skip output to STDOUT.
  • --reload_list_config --list=mylist@dom
    Recreates all configbin files. You should run this command if you edit authorization scenarios. The list parameter is optional.
  • --sync_include listaddress
    Triggers an update of list members, useful if the list uses external data sources.
  • --upgrade --from=X --to=Y
    Runs Sympa maintenance script to upgrade from version X to version Y.
  • --version | -v
    Prints current version of Sympa.
manual/running-sympa.txt · Last modified: 2016/07/01 09:08 by ikeda@conversion.co.jp

The Sympa software is provided by RENATER
Faq | News | Contact | Legal Notices