{"id":68,"date":"2020-10-22T05:36:05","date_gmt":"2020-10-22T05:36:05","guid":{"rendered":"http:\/\/dicasdolaroque.com.br\/?p=68"},"modified":"2020-11-03T18:45:57","modified_gmt":"2020-11-03T18:45:57","slug":"gerenciamento-de-servicos-com-systemd","status":"publish","type":"post","link":"https:\/\/www.dicasdolaroque.com.br\/?p=68","title":{"rendered":"Gerenciamento de Servi\u00e7os com Systemd"},"content":{"rendered":"\n<p>Link para o v\u00eddeo: <a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w\">https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w<\/a><\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe  id=\"_ytid_33037\"  width=\"1440\" height=\"810\"  data-origwidth=\"1440\" data-origheight=\"810\"  src=\"https:\/\/www.youtube.com\/embed\/2qZye8WH_7w?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;iv_load_policy=1&#038;loop=0&#038;modestbranding=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;\" class=\"__youtube_prefs__  epyt-is-override  no-lazyload\" title=\"YouTube player\"  allow=\"autoplay; encrypted-media\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Neste v\u00eddeo, \u00e9 mostrado como gerenciar servi\u00e7os que rodam em um servidor GNU Linux usando o systemd (substituto do SysVInit).<\/p>\n\n\n\n<p>O systemd \u00e9 um inicializador e gerenciador dos recursos de m\u00e1quinas Linux, que assume a m\u00e1quina como processo init (PID 1) logo ap\u00f3s o kernel fazer o boot. A grosso modo, o processo de inicializa\u00e7\u00e3o de uma m\u00e1quina Linux segue mais ou menos a sequ\u00eancia: (BIOS\/UEFI) &#8211; (MBR\/GPT) &#8211; (GRUB boot loarder) &#8211; Linux Kernel &#8211; (init\/systemd) &#8211; (Runlevel).<\/p>\n\n\n\n<p><strong>Alguns comandos usados:<\/strong> systemctl (start, status, stop, restart, reload, reboot, rescue, halt, poweroff, isolate, cat, shot, edit, mask, unmask, enable, disable, is-active, is-enabled, is-failed, list-dependencies, list-timers), journalctl, ifconfig, w, ip addr, watch, su, sudo, apt update, apt-cache search, apt install, apt remove &#8211;purge, netstat, grep, xargs, rm, ls, dpkg, cat, id, w3m <\/p>\n\n\n\n<p><strong>\u00cdndice do v\u00eddeo:<\/strong> <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=0s\">00:00<\/a> Vinheta <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=17s\">00:17<\/a> Apresenta\u00e7\u00e3o <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=24s\">00:24<\/a> O Systemd como inicializador e gerenciador do sistema operacional GNU Linux <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=53s\">00:53<\/a> A compatibilidade retroativa do Systemd com o SysVInit <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=74s\">01:14<\/a> Vis\u00e3o b\u00e1sica sobre o funcionamento do Systemd <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=174s\">02:54<\/a> Principais diret\u00f3rios de configura\u00e7\u00e3o do Systemd <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=225s\">03:45<\/a> Principais comandos usados para gerenciar os recursos da m\u00e1quina com o Systemd <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=356s\">05:56<\/a> Acessando o servidor remoto de testes via SSH <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=491s\">08:11<\/a> Instalando os pacotes net-tools e sudo <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=541s\">09:01<\/a> Verificando as configura\u00e7\u00f5es IP da m\u00e1quina e os servi\u00e7os de rede ativos <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=569s\">09:29<\/a> Removendo software para sanear o ambiente <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=823s\">13:43<\/a> Concess\u00e3o de permiss\u00e3o de sudo para usu\u00e1rio que far\u00e1 o papel de sysadmin da m\u00e1quina <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=1036s\">17:16<\/a> Verificando se o comando systemd est\u00e1 dispon\u00edvel para o novo sysadmin <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=1094s\">18:14<\/a> Listando unidades do Systemd <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=1251s\">20:51<\/a> Instando o servidor nginx e listando o status do servi\u00e7o <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=1407s\">23:27<\/a> Instalando o pstree <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=1522s\">25:22<\/a> Testando os comandos status, stop, start e restart do systemctl para o servi\u00e7o nginx <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=1707s\">28:27<\/a> Listando o conte\u00fado da unidade nginx.service do systemd <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=1921s\">32:01<\/a> Verificando a porta onde roda o nginx com o netstat <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=1968s\">32:48<\/a> Instalando o w3m (navegador web modo texto) para testes do servidor web rodando da m\u00e1quina <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=2042s\">34:02<\/a> O uso do comando musk (e unmask) para impedir que um determinado servi\u00e7o seja iniciado temporariamente <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=2131s\">35:31<\/a> Instalando o servidor web Apache na mesma porta 80 ocupada (e mascarada) pelo nginx para testes de solu\u00e7\u00e3o de conflito de portas TCP <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=2192s\">36:32<\/a> Testes de conflito e resolu\u00e7\u00e3o do problema envolvendo o nginx e o Apache na mesma porta 80\/TCP <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=2677s\">44:37<\/a> Fazendo um reboot do servidor remoto para ver como se comportam os servi\u00e7os nginx e Apache <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=2931s\">48:51<\/a> Desativando o Apache, reativando o nginx e fazendo os testes finais <\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w&amp;t=3319s\">55:19<\/a> Listando as depend\u00eancias de um servi\u00e7o <\/p>\n\n\n\n<p><strong>Link para este v\u00eddeo:<\/strong> <a href=\"https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w\">https:\/\/youtu.be\/2qZye8WH_7w<\/a> <\/p>\n\n\n\n<p><strong>Link do canal:<\/strong> <a href=\"https:\/\/www.youtube.com\/channel\/UCiCi6VigZ5YGQrBJ9bJ-6Dw\">https:\/\/www.youtube.com\/channel\/UCiCi&#8230;<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Link para o v\u00eddeo: https:\/\/www.youtube.com\/watch?v=2qZye8WH_7w Neste v\u00eddeo, \u00e9 mostrado como gerenciar servi\u00e7os que rodam em um servidor GNU Linux usando o systemd (substituto do SysVInit). O systemd \u00e9 um inicializador e gerenciador dos recursos de m\u00e1quinas Linux, que assume a m\u00e1quina como processo init (PID 1) logo ap\u00f3s o kernel<span class=\"more-link\"><a href=\"https:\/\/www.dicasdolaroque.com.br\/?p=68\">Detalhes<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":69,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"qubely_global_settings":"","qubely_interactions":""},"categories":[6],"tags":[],"qubely_featured_image_url":{"full":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",720,396,false],"landscape":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",720,396,false],"portraits":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",540,297,false],"thumbnail":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306-150x150.png",150,150,true],"medium":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306-300x165.png",300,165,true],"medium_large":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306-768x422.png",768,422,true],"large":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306-1024x563.png",1024,563,true],"1536x1536":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306-1536x845.png",1536,845,true],"2048x2048":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306-2048x1126.png",2048,1126,true],"qubely_landscape":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",720,396,false],"qubely_portrait":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",540,297,false],"qubely_thumbnail":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",140,77,false],"hoot-medium-thumb":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",460,253,false],"hoot-preview":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",465,256,false],"hoot-preview-thumb":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",465,256,false],"hoot-large-thumb":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",690,380,false],"hoot-preview-large":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",695,382,false],"hoot-wide-thumb":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",720,396,false],"hoot-extra-wide-thumb":["https:\/\/www.dicasdolaroque.com.br\/wp-content\/uploads\/2020\/10\/Dicas-do-La-Roque-Capa-do-Video-Linux-Gerenciamento-de-Servicos-com-Systemd-20201009-0306.png",720,396,false]},"qubely_author":{"display_name":"Edinaldo La-Roque","author_link":"https:\/\/www.dicasdolaroque.com.br\/?author=1"},"qubely_comment":13,"qubely_category":"<a href=\"https:\/\/www.dicasdolaroque.com.br\/?cat=6\" rel=\"category\">Linux Fundamentos<\/a>","_links":{"self":[{"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=\/wp\/v2\/posts\/68"}],"collection":[{"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=68"}],"version-history":[{"count":11,"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":145,"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=\/wp\/v2\/posts\/68\/revisions\/145"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=\/wp\/v2\/media\/69"}],"wp:attachment":[{"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dicasdolaroque.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}