{"id":1613,"date":"2018-07-17T18:57:41","date_gmt":"2018-07-17T23:57:41","guid":{"rendered":"http:\/\/blog.espol.edu.ec\/blackstar\/?p=1613"},"modified":"2018-07-17T18:57:41","modified_gmt":"2018-07-17T23:57:41","slug":"creacion-monitoreo-y-finalizacion-de-procesos-en-debian","status":"publish","type":"post","link":"https:\/\/blog.espol.edu.ec\/blackstar\/creacion-monitoreo-y-finalizacion-de-procesos-en-debian\/","title":{"rendered":"Creaci\u00f3n, Monitoreo y Finalizaci\u00f3n de Procesos en Debian"},"content":{"rendered":"<div style=\"text-align: justify\">\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/4.bp.blogspot.com\/-lhuSYWk9xQ4\/VhhLnQU-ZeI\/AAAAAAAACCI\/N_2IM_CcKoM\/s1600\/Tutoriales-Black-Star.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Tutoriales Black Star\" src=\"http:\/\/4.bp.blogspot.com\/-lhuSYWk9xQ4\/VhhLnQU-ZeI\/AAAAAAAACCI\/N_2IM_CcKoM\/s400\/Tutoriales-Black-Star.png\" alt=\"Tutoriales Black Star\" width=\"400\" height=\"128\" border=\"0\" \/><\/a><\/div>\n<p>Monitorear y finalizar procesos puede ser algo bastante \u00fatil en debian, esto se lo puede realizar a trav\u00e9s de una serie de comandos que analizaremos a continuaci\u00f3n, pero antes debemos instalar el paquete necesario para poder utilizar el comando \"kill\" que no permitir\u00e1 finalizar procesos.<\/p>\n<\/div>\n<div style=\"text-align: justify\"><\/div>\n<div style=\"text-align: justify\">primero debemos instalar el paquete \"psmisc\" de la siguiente forma<\/div>\n<div style=\"text-align: justify\"><\/div>\n<ul>\n<li>apt-get install psmisc<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/3.bp.blogspot.com\/-dsk9QaugQtk\/Vf95KqpVugI\/AAAAAAAAB7g\/eJ-yaJeQpJY\/s1600\/practica%2B1.png\"><img loading=\"lazy\" decoding=\"async\" title=\"\" src=\"http:\/\/3.bp.blogspot.com\/-dsk9QaugQtk\/Vf95KqpVugI\/AAAAAAAAB7g\/eJ-yaJeQpJY\/s320\/practica%2B1.png\" alt=\"Creaci\u00f3n, Monitoreo y Finalizaci\u00f3n de Procesos en Debian\" width=\"320\" height=\"177\" border=\"0\" \/><\/a><\/div>\n<p><!--more--><\/p>\n<div style=\"text-align: justify\">Y una vez completada la instalaci\u00f3n comprobamos que este instalado correctamente.<\/div>\n<div style=\"text-align: justify\"><\/div>\n<ul>\n<li>man killall<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/1.bp.blogspot.com\/-Rsd2gyvSO7M\/Vf95Koc061I\/AAAAAAAAB7w\/Pke9bov0x-w\/s1600\/practica%2B2.png\"><img loading=\"lazy\" decoding=\"async\" title=\"\" src=\"http:\/\/1.bp.blogspot.com\/-Rsd2gyvSO7M\/Vf95Koc061I\/AAAAAAAAB7w\/Pke9bov0x-w\/s320\/practica%2B2.png\" alt=\"Creaci\u00f3n, Monitoreo y Finalizaci\u00f3n de Procesos en Debian\" width=\"320\" height=\"177\" border=\"0\" \/><\/a><\/div>\n<div style=\"text-align: justify\"><\/div>\n<div style=\"text-align: justify\">Ahora para poder hacer las pruebas iniciaremos sesi\u00f3n con un usuario que no sea el root en nuestro caso previamente creamos el usuario \"alumno\" crearemos un archivo ejecutable y le damos los permisos necesarios de la siguiente forma.<\/div>\n<div style=\"text-align: justify\"><\/div>\n<ul>\n<li><span style=\"text-align: justify\">echo \"while sleep 5;do date;done\" &gt; prueba.sh<\/span><\/li>\n<li>chmod 777 prueba.sh<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/3.bp.blogspot.com\/-nEDylyBCMz0\/Vf95Kuo1CnI\/AAAAAAAAB74\/WPsrxNnCQvg\/s1600\/practica%2B3.png\"><img loading=\"lazy\" decoding=\"async\" title=\"\" src=\"http:\/\/3.bp.blogspot.com\/-nEDylyBCMz0\/Vf95Kuo1CnI\/AAAAAAAAB74\/WPsrxNnCQvg\/s320\/practica%2B3.png\" alt=\"Creaci\u00f3n, Monitoreo y Finalizaci\u00f3n de Procesos en Debian\" width=\"320\" height=\"177\" border=\"0\" \/><\/a><\/div>\n<div style=\"text-align: justify\"><\/div>\n<div style=\"text-align: justify\">Luego verificamos que el \"huponexit\" este habilitado<\/div>\n<div style=\"text-align: justify\"><\/div>\n<ul>\n<li>shopt | grep huponexit<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify\">si esta off lo activamos<\/div>\n<div style=\"text-align: justify\"><\/div>\n<ul>\n<li>shopt -s huponexit<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/2.bp.blogspot.com\/-OzB4m-oCZAs\/Vf95K2w1jQI\/AAAAAAAAB8A\/sW4KuPal4pM\/s1600\/practica%2B4.png\"><img loading=\"lazy\" decoding=\"async\" title=\"\" src=\"http:\/\/2.bp.blogspot.com\/-OzB4m-oCZAs\/Vf95K2w1jQI\/AAAAAAAAB8A\/sW4KuPal4pM\/s320\/practica%2B4.png\" alt=\"Creaci\u00f3n, Monitoreo y Finalizaci\u00f3n de Procesos en Debian\" width=\"320\" height=\"177\" border=\"0\" \/><\/a><\/div>\n<div style=\"text-align: justify\"><\/div>\n<div style=\"text-align: justify\">y ejecutamos nuestro archivo junto con el comando \"nohup\" el cual har\u00e1 que el proceso se siga ejecutando aun cuando el usuario cierre sesi\u00f3n.<\/div>\n<div style=\"text-align: justify\"><\/div>\n<ul>\n<li>nohup .\/prueba.sh &amp;<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/2.bp.blogspot.com\/-uLixrdHRXeY\/Vf95LDoofRI\/AAAAAAAAB78\/bODFOLnm04Y\/s1600\/practica%2B5.png\"><img loading=\"lazy\" decoding=\"async\" title=\"\" src=\"http:\/\/2.bp.blogspot.com\/-uLixrdHRXeY\/Vf95LDoofRI\/AAAAAAAAB78\/bODFOLnm04Y\/s320\/practica%2B5.png\" alt=\"Creaci\u00f3n, Monitoreo y Finalizaci\u00f3n de Procesos en Debian\" width=\"320\" height=\"177\" border=\"0\" \/><\/a><\/div>\n<div style=\"text-align: justify\"><\/div>\n<div style=\"text-align: justify\">Luego cambiamos nuevamente con el usuario root e ingresamos a la ruta <i>\/home\/alumno\/<\/i> \u00a0y con el comando \"tail\" verificamos el resultado del proceso que iniciamos antes.<\/div>\n<div style=\"text-align: justify\"><\/div>\n<ul>\n<li>tail -f \/home\/alumno\/nohup.out<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/2.bp.blogspot.com\/-CDx2wJG4-ZY\/Vf95LFArAoI\/AAAAAAAAB8E\/Gr-2b055pA4\/s1600\/practica%2B6.png\"><img loading=\"lazy\" decoding=\"async\" title=\"\" src=\"http:\/\/2.bp.blogspot.com\/-CDx2wJG4-ZY\/Vf95LFArAoI\/AAAAAAAAB8E\/Gr-2b055pA4\/s320\/practica%2B6.png\" alt=\"Creaci\u00f3n, Monitoreo y Finalizaci\u00f3n de Procesos en Debian\" width=\"320\" height=\"177\" border=\"0\" \/><\/a><\/div>\n<div style=\"text-align: justify\"><\/div>\n<div style=\"text-align: justify\">Con el comando \"ps aux\" podemos comprobar el proceso que inicio el usuario alumno, y usando el comando \"killall\" podemos detenerlo, de la siguiente forma<\/div>\n<div style=\"text-align: justify\"><\/div>\n<ul>\n<li>ps aux|grep sleep<\/li>\n<li>killall sleep<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify\">Es este caso usamos el comando \"jobs\" pero al haber sido el usuario alumno el que inicio el proceso al usarlo\u00a0en el usuario root no nos da ning\u00fan resultado..<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Monitorear y finalizar procesos puede ser algo bastante \u00fatil en debian, esto se lo puede realizar a trav\u00e9s de una serie de comandos que analizaremos a continuaci\u00f3n, pero antes debemos instalar el paquete necesario para poder utilizar el comando \"kill\" que no permitir\u00e1 finalizar procesos. primero debemos instalar el paquete \"psmisc\" de la siguiente forma &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/blog.espol.edu.ec\/blackstar\/creacion-monitoreo-y-finalizacion-de-procesos-en-debian\/\">Seguir leyendo<\/a><\/p>\n","protected":false},"author":2011,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[599],"class_list":["post-1613","post","type-post","status-publish","format-standard","hentry","category-general","tag-tutoriales","item-wrap"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.espol.edu.ec\/blackstar\/wp-json\/wp\/v2\/posts\/1613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.espol.edu.ec\/blackstar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.espol.edu.ec\/blackstar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/blackstar\/wp-json\/wp\/v2\/users\/2011"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/blackstar\/wp-json\/wp\/v2\/comments?post=1613"}],"version-history":[{"count":1,"href":"https:\/\/blog.espol.edu.ec\/blackstar\/wp-json\/wp\/v2\/posts\/1613\/revisions"}],"predecessor-version":[{"id":1614,"href":"https:\/\/blog.espol.edu.ec\/blackstar\/wp-json\/wp\/v2\/posts\/1613\/revisions\/1614"}],"wp:attachment":[{"href":"https:\/\/blog.espol.edu.ec\/blackstar\/wp-json\/wp\/v2\/media?parent=1613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/blackstar\/wp-json\/wp\/v2\/categories?post=1613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/blackstar\/wp-json\/wp\/v2\/tags?post=1613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}