{"id":3274,"date":"2016-08-16T13:23:54","date_gmt":"2016-08-16T11:23:54","guid":{"rendered":"https:\/\/adrhc.go.ro\/wordpress\/?p=3274"},"modified":"2017-06-09T10:25:19","modified_gmt":"2017-06-09T08:25:19","slug":"systemd-systemctl","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/systemd-systemctl\/","title":{"rendered":"Systemd and systemctl"},"content":{"rendered":"<pre class=\"brush:bash shell;toolbar: false\">\r\n# see https:\/\/www.freedesktop.org\/wiki\/Software\/systemd\/TipsAndTricks\/\r\n\r\nsystemctl                           -> shows all active units\r\nsystemctl list-units --type=service -> shows all active services (--all to see loaded but inactive services too)\r\nsystemctl list-units --type=swap\t-> shows swap unit configurations\r\n\r\n# show cgroup tree\r\nsystemd-cgls\r\n\r\n# services started by multi-user.target\r\nsystemctl show -p \"Wants\" multi-user.target | less\r\n\r\n###################\r\n# svnserve.service:\r\n#\r\n# sudo chown ************ bin\/svnserve.service && sudo chmod 664 bin\/svnserve.service && cp -v bin\/svnserve.service \/etc\/systemd\/system\/ && sudo chown root: \/etc\/systemd\/system\/svnserve.service && sudo chmod 664 \/etc\/systemd\/system\/svnserve.service && sudo systemctl daemon-reload\r\n# or\r\n# sudo chown ************ bin\/svnserve.service\r\n# sudo chmod 664 bin\/svnserve.service\r\n# cp -v bin\/svnserve.service \/etc\/systemd\/system\/\r\n# sudo chown root: \/etc\/systemd\/system\/svnserve.service\r\n# sudo chmod 664 \/etc\/systemd\/system\/svnserve.service\r\n# sudo systemctl daemon-reload\r\n\r\n# sudo systemctl status svnserve\r\n# sudo systemctl enable svnserve\r\n# sudo systemctl start svnserve\r\n# journalctl -xe\r\n# journalctl -xf\r\n\r\n[Unit]\r\nDescription=Server for the 'svn' repository access method\r\n\r\n# see https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.unit.html#\r\n# see https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.special.html#\r\nAfter=local-fs.target\r\nWants=local-fs.target\r\n\r\n[Service]\r\nType=forking\r\n\r\nUser****\r\nGroup*********\r\n\r\nRuntimeDirectory=svnserve\r\nRuntimeDirectoryMode=750\r\n\r\nPIDFile=\/run\/svnserve\/svnserve.pid\r\n\r\n# RuntimeDirectory is doing this:\r\n# User****\r\n# Group*********\r\n# PIDFile=\/run\/svnserve\/svnserve.pid\r\n# PermissionsStartOnly=true\r\n# ExecStartPre=\/bin\/mkdir \/run\/svnserve\r\n# ExecStartPre=\/bin\/chown ************ \/run\/svnserve\r\n\r\nKillMode=process\r\nRestart=on-failure\r\nRestartSec=3\r\n\r\n# A shorthand for configuring both TimeoutStartSec= and TimeoutStopSec= to the specified value.\r\nTimeoutSec=5\r\n\r\n# -r root, --root=root\r\n#\tSets  the  virtual  root for repositories served by svnserve.  \r\n#\tThe pathname in URLs provided by the client will be interpreted \r\n#\trelative to this root, and will not be allowed to escape this root.\r\nExecStart=\/usr\/bin\/svnserve -d -r \/mnt\/1TB\/DataWin_to_sync\/SVNRepoLinux --log-file \/********\/apps\/log\/svnserve.log --pid-file \/run\/svnserve\/svnserve.pid\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n\r\n######################\r\n# couchpotato.service:\r\n#\r\n[Unit]\r\nDescription=CouchPotato\r\nAfter=local-fs.target\r\nWants=local-fs.target\r\n\r\n[Service]\r\nType=simple\r\nUser****\r\nGroup*********\r\nRuntimeDirectory=couchpotato\r\nRuntimeDirectoryMode=750\r\nPIDFile=\/run\/couchpotato\/couchpotato.pid\r\n# KillMode=process\r\n# Restart=on-failure\r\n# RestartSec=3\r\nTimeoutStartSec=60\r\nTimeoutStopSec=15\r\n\r\n# couchpotato.service: Supervising process 22342 which is not our child. We'll most likely not notice when it exits\r\n#\r\n# ExecStart=\/usr\/bin\/python \/********\/apps\/opt\/couchpotato\/CouchPotato.py --config_file \/********\/apps\/etc\/couchpotato.conf --daemon --data_dir \/********\/apps\/opt\/couchpotato_data --pid_file \/run\/couchpotato\/couchpotato.pid\r\n\r\nExecStart=\/usr\/bin\/python \/********\/apps\/opt\/couchpotato\/CouchPotato.py --config_file \/********\/apps\/etc\/couchpotato.conf --data_dir \/********\/apps\/opt\/couchpotato_data --quiet\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n\r\n###################\r\n# anytermd.service:\r\n#\r\n[Unit]\r\nDescription=A Terminal Anywhere\r\nAfter=local-fs.target\r\nWants=local-fs.target\r\n\r\n[Service]\r\nType=forking\r\nPIDFile=\/run\/anytermd.pid\r\n\r\nKillMode=process\r\nRestart=on-failure\r\nRestartSec=3\r\nTimeoutSec=5\r\n\r\n# anytermd.service: Main process exited, code=exited, status=1\/FAILURE\r\n#\r\n# ExecStart=\/********\/apps\/bin\/anytermd --command \"\/bin\/login -p adr\" --port 23456 --user root --local-only\r\n# ExecStart=\/********\/apps\/bin\/anytermd --command \"\/bin\/login -p adr\" --port 23456 --user root --foreground --local-only\r\nSuccessExitStatus=1\r\nExecStart=\/********\/apps\/bin\/anytermd --command \"\/bin\/login -p adr\" --port 23456 --user root --local-only\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n\r\n################\r\n# tomcat.service\r\n#\r\n[Unit]\r\nDescription=Apache Tomcat\r\nAfter=local-fs.target network.target\r\nWants=local-fs.target\r\n\r\n[Service]\r\nType=forking\r\nWorkingDirectory=~\r\nRuntimeDirectory=tomcat\r\nRuntimeDirectoryMode=750\r\nPIDFile=\/run\/tomcat\/tomcat.pid\r\nUser****\r\nGroup*********\r\nEnvironment=CATALINA_HOME=\/********\/apps\/opt\/apache-tomcat-7.0.64\r\nEnvironment=CATALINA_PID=\/run\/tomcat\/tomcat.pid\r\nPermissionsStartOnly=true\r\nExecStartPre=\/bin\/rm -vf \/********\/apps\/opt\/apache-tomcat-7.0.64\/logs\/*\r\nExecStartPre=\/bin\/rm -vf \/********\/exifweb*.log\r\n\r\n## KillMode=process\r\n# Restart=on-failure\r\n# RestartSec=3\r\nTimeoutStartSec=60\r\nTimeoutStopSec=15\r\n\r\n# ExecStart=\/bin\/sh -c 'CATALINA_PID=\/run\/tomcat.pid \/********\/apps\/opt\/apache-tomcat-7.0.64\/bin\/startup.sh'\r\nExecStart=\/********\/apps\/opt\/apache-tomcat-7.0.64\/bin\/startup.sh\r\nExecStop=\/********\/apps\/opt\/apache-tomcat-7.0.64\/bin\/shutdown.sh\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># see https:\/\/www.freedesktop.org\/wiki\/Software\/systemd\/TipsAndTricks\/ systemctl -> shows all active units systemctl list-units &#8211;type=service -> shows all active services (&#8211;all to see loaded but inactive services too) systemctl list-units &#8211;type=swap -> shows swap unit configurations # show cgroup tree systemd-cgls # services [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/systemd-systemctl\/#more-3274\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Systemd and systemctl<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,11],"tags":[],"class_list":["post-3274","post","type-post","status-publish","format-standard","hentry","category-howto","category-linux"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/3274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=3274"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/3274\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=3274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=3274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=3274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}