Friday 25 August 2017

Mudança Média Gnu R


Linux no Mac Mini (Este artigo foi traduzido para o espanhol por Maria Ramos Webhostinghub Gracias, Maria) A primeira geração de sistemas Mac Mini usou os processadores PowerPC G4. Esta página descreve principalmente uma técnica para instalar o Debian nesses anteriores sistemas baseados no PowerPC G4. Agora, eu adicionei um pequeno guia para instalar o Ubuntu nos sistemas mais recentes baseados em Intel. Os sistemas Mac Mini enviados desde fevereiro de 2006 contêm processadores Intel Core Duo e um chipset Intel 945GM ICH7M. Em outras palavras, eles são PCs regulares usando a plataforma Intel Centrino, modulo algum firmware sofisticado, e com um pouco de persuasão pode executar Linux ou i386 Linux. Temos um i386 (Intel) e um PowerPC Mac Mini. O i386 Mac Mini dual carrega o MacOS X e um pré-lançamento do Ubuntu 6.10 (Edgy Eft Knot 2). O Ubuntu é uma distribuição baseada em Debian com foco na usabilidade do desktop e em versões estáveis ​​e estáveis. Na foto abaixo, o ICBM (Macintosh baseado em chips Intel) está no topo, com o sistema G4 embaixo. As dimensões e as cores da tinta coincidem exatamente, embora a largura da ranhura da unidade óptica seja mais larga no ICBM para permitir espaço em um lado para o receptor infravermelho, e o G4 tem um chanfro muito pequeno em torno da borda superior que o ICBM faz não. Heres um guia supercondensado para instalar o Ubuntu no i386 Mini. Eu não tentaria isso a menos que você confia em poder montar sua partição raiz e instalar o GRUB à mão da linha de comando, ou você não se importa de abandonar a coisa inteira e de reinstalar a partir do MacOS X DVD. Existem guias mais abrangentes on-line se você ficar preso, por exemplo, você poderia começar a ler aqui. Eu não escreverei uma discussão detalhada sobre o hardware, já que já existem muitas peças bem escritas online. De qualquer forma. Misture uma bebida fraca de limão e vamos começar. Inicie o MacOS X Baixe e instale o Boot Camp. Esta ferramenta permite redimensionar sua partição HFS existente sem formatação. Faça espaço suficiente para a sua instalação do Ubuntu e, em seguida, abandone a ferramenta quando solicitar o seu CD do Windows XP. Baixe e instale o REFIt. Um gerenciador de inicialização EFI. REFI permitirá que você escolha entre MacOS X e Ubuntu quando você ligar. Siga as instruções para instalá-lo no seu volume MacOS X. Baixe e grave um i386 Ubuntu CD (usei o Edgy Eft Knot 2 porque era o mais recente no momento). Pope o CD na unidade, reinicie (permita-o arrancar a partir do disco rígido, não é necessário forçar uma inicialização do CD). Você deve terminar no menu REFIt. Use a ferramenta REFIts partition tool para copiar o mapa de partição GPT para o MBR. O novo formato de partição GPT pode lidar com discos muito grandes e contém o mapa de partição canônica. O antigo mapa de partição MBR deve conter uma sombra desta informação e é usado aqui principalmente pelo carregador de inicialização GRUB. Tenho certeza de que um dia em breve rEFI irá inicializar o kernel Linux do Ubuntus diretamente e será capaz de ignorar isso. Diga ao REFIt para inicializar a partir do CD. Você deve aterrar em uma área de trabalho Ubuntu, executando diretamente do CD. Use o ícone Instalar para instalar no disco rígido. Não permita que o sistema reparticione automaticamente o disco Use o editor de partição manual e formateie a partição que o Boot Camp fez para o Windows (provavelmente é o último no disco) como seu sistema de arquivos raiz. Se você se sentir aventureiro, exclua-o e crie duas partições, uma para troca e outra para raiz - embora isso possa ter implicações quando você instala o carregador de inicialização (veja o próximo ponto). Descobri que não consegui instalar o GRUB depois de dividir a partição criada pelo Boot Camp usando o editor de partição do Ubuntu. A razão parece ser que o editor de partição do Ubuntu reescreveu o mapa de partição do GPT, mas não somou esta informação no mapa de partição MBR (presumivelmente assume que todos os sistemas GPT são apenas GPT). A correção foi para reiniciar, use a ferramenta de mapa de partição em REFIt para atualizar o mapa de som no MBR e reinicie novamente no CD do Ubuntu e instale o GRUB à mão. Eu instalei no setor de inicialização da minha partição da raiz Ubuntu (que foi marcada como inicializável no mapa de partição) em vez de no MBR. Uma alternativa seria instalar por segunda vez, sem repartição no Ubuntu, o que seria mais fácil, mas mais demorado. Não testei se esta segunda técnica funciona, lector de advertência. . Lucro Se você tentar isso, fique curioso para saber como você segue essa técnica. Eu não posso fazer tanta experiência com a caixa i386 como pude com o PowerPC porque a Celia e eu já estamos usando isso para um trabalho real. Agora o devolvemos a sua programação agendada regularmente. A partir deste ponto, você deve ler Mac Mini como G4 Mac Mini. Não há mais discussões sobre o Mac Minis baseado em Intel nesta página. Maquinas de primeira geração Mac Mini é algo que muitos usuários de Linux esperaram: um sistema PowerPC barato e prontamente disponível em um chassi pequeno, silencioso e atraente. O Debian é muito popular nos sistemas compatíveis com Intel i386. Devido à natureza aberta do kernel do Linux e ao sistema operacional Debian, é possível construir o mesmo software para executar no processador PowerPC encontrado dentro do Mac Mini. É simples trocar o seu antigo e antigo PC para o Slim e o Mac Mini, e esta página pretende mostrar-lhe como fazer exatamente isso. Pessoalmente, comprei o Mac Mini como um substituto para o sistema Pentium-III de 1GHz de minha namorada. Graças à portabilidade do Debian e suas avançadas ferramentas de gerenciamento de pacotes, fazer com que seu novo Mac pareça que seu PC antigo demorou apenas uma hora ou mais. A especificação do hardware é um pouco menos que estelar segundo os padrões de 2005, mas ainda é perfeitamente adequada. Pode-se escolher entre um PowerPC G4 de 1,25 GHz ou 1,42GHz, ambos com o cache L2 de injeção de 512K e um barramento frontal da MaxBus 166MHz. Isso é marcadamente menos poderoso do que os sistemas contemporâneos Intel ou AMD x86, mas, para a maioria esmagadora das tarefas, isso é uma habilidade de processamento suficiente. Se você precisar de mais energia, você sempre pode empilhar mais alguns Minis no topo -) A vantagem do G4 usado no Mac Mini é que produz muito pouco calor em relação a um processador x86 com potência computacional comparável, tornando-o ideal para o Pequeno espaço dentro do Mac Mini. O G4 usado se dissipa em torno de 21W a 1.42GHz e 18.3W a 1.25GHz. O outro hardware na caixa também é maduro e confiável (ou, se você é um copo de pessoa meio vazia, barato e lento). O Mac Mini possui uma GPU RV280 (Radeon 9200) com 32MB de DDR SDRAM dedicado. O RV280 tem quatro tubulações de renderização, transformada de geometria de hardware e aceleração de iluminação, e sombradores de pixel e vertex programáveis. No meu Mac Mini, o GPU é sincronizado a 250MHz e a memória gráfica é sincronizada com 190MHz DDR. É mais do que adequado para as pessoas que não estão interessadas em jogar os últimos jogos em 3D. Grande parte do hardware 3D é suportado pelo XFree86, que é uma excelente notícia. O sistema possui um único soquete DIMM que possui módulos padrão PC2700, embora seja um pouco complicado para obter acesso a ele. A maior atualização disponível atualmente é um módulo de 1GB, mas acredito que o Mac Mini também será certificado para uso com módulos de 2GB quando entrarem na produção. Para o usuário médio do Linux, 1GB será mais que adequado. O fornecimento de 256 MB de Apple é muito pouco para o Mac OS X. Por motivos de calor e ruído, a Apple optou por usar um disco rígido de 2.5 (tamanho laptop) no Mac Mini, tornando as atualizações do usuário final fantásticas e dispendiosas. O disco rígido de 40 GB ou 80 GB fornecido é improvável que seja grande o suficiente para todos. A Apple parece enviar uma mistura de unidades de 4200rpm e 5400rpm no tamanho de 40GB, mas atualmente todas as unidades de 80GB são 4200rpm. As unidades de 5400 rpm aparentemente são mais rápidas, presumivelmente devido aos seus tempos de busca de cabeça mais curtos. Minha unidade possui um Toshiba MK8025GAS de 80GB. O Mac Mini usa a ponte norte das maçãs Intrepid. Parece ser uma derivada muito compacta do design da placa-mãe eMacs. Este diagrama ilustra o hardware no Mac Mini exatamente como posso. Observe que o MaxBus e SDRAM são sincronizados a 166MHz e a unidade óptica interna está configurada como um dispositivo escravo no mesmo barramento ATA-100 usado pelo disco rígido. Esta é uma medida de economia de custos na parte Apples, já que o chipset Intrepid possui um segundo canal ATA que pode ser usado para a unidade óptica. O cartão do aeroporto e os módulos Bluetooth são montados em um cartão mezzanine opcional. Se o seu sistema não veio com nenhuma dessas opções, o cartão entrelinha não estará presente. Dizem-me que o modem não está presente em modelos vendidos no mercado educacional. Apples Developer Note no Mac Mini agora está online. É silencioso - muito quieto. Mas não é silencioso. O único ruído é o zumbido quase audível do disco rígido. Graças aos rolamentos dinâmicos de fluidos, esta não é a irritante queixinha aguda que produziram mais de 2,5 discos. Estou muito pernickety sobre o barulho, e eu acho isso bastante aceitável. Depois de alguns meses, atualizei o disco interno no meu G4 para um modelo 7200rpm 2.5 (Hitachi TravelStar 7K60), que é muito ligeiramente mais alto, 20GB menor, mas notavelmente mais rápido. O Mac Mini possui uma fonte de alimentação externa de 85W sem ventilador, aproximadamente metade do tamanho do próprio Mac (imagem aqui), movendo uma fonte importante de calor do chassi metálico. Combinado com os processadores G4 com uma velocidade de clock relativamente baixa, esta foi presumivelmente chave para o design térmico das maçãs. Ter menos calor para dissipar significa que, enquanto o Mac Mini possui um pequeno ventilador de refrigeração, ele raramente gira até uma alta velocidade. Realizar um trabalho de escritório normal é inaudível. O único ruído que sai do Mac Mini é o zumbido silencioso do disco rígido, e mesmo isso pode girar automaticamente quando o sistema está completamente ocioso. A unidade óptica é relativamente alta quando em uso. Eu nunca uso mídias ópticas, então isso não me incomoda. Pode incomodá-lo. A atualização da RAM requer a abertura do gabinete. Veja esta página. Onde você pode baixar um bom PDF e um vídeo mostrando como desmontar o sistema. Na verdade, o PDF é um guia de manutenção completo, presumivelmente escrito para técnicos de serviços da Apple. Você precisará de uma faca puttyspreading, certifique-se de comprar o mais fino possível. A ferramenta que usei é extremamente fina e elástica e, ainda assim, deixou pequenas marcas de gouge na base do chassi. Não tente abrir o seu Mac, a menos que esteja familiarizado com a abertura de dispositivos eletrônicos de consumo. Se você quebrar seu Mac, você consegue manter as duas metades. Processador MPC7447A (G4) com Altivec Apple Airport Extreme (802.11g) Suportado (trabalho em andamento) Não esperava que o 802.11g wireless (Airport Extreme) nunca funcionasse. O módulo Apple Airport Extreme usa um chipset PCI 802.11g da Broadcom, e não havia especificações disponíveis para escrever um driver de código aberto para este hardware. No entanto, algumas pessoas muito dedicadas se propuseram a engenharia reversa do hardware e a escrever suas próprias especificações. Isso permitiu que uma segunda equipe produza um driver de código aberto para chips Broadcom BCM43xx. Esse driver está incluído nos kernels do linux recentes. Não tenho certeza sobre o modem ou o módulo Bluetooth opcional, ainda não fui testado. Ben Herrenschmidt (todos os elogios do BenH) corrigiu o driver de áudio. Aparentemente, seu patch está no kernel 2.6.12-rc4 ou posterior, e você precisa de alsa-lib 1.0.9rc3 ou posterior. Alguns problemas estranhos que eu descobri: se eu ligar a porta firewire na porta firewire no meu PC, parece interferir com a fonte de alimentação dos PCs. É como pressionar o botão de reinicialização no PC. Isso torna impossível usar o modo de disco alvo firewire no Mac Mini. Isso pode vir a ser um problema com o cartão firewire no meu PC. Não fui capaz de testar com outro sistema ainda. O driver radeon no kernel 2.6.10 não pode conduzir de forma confiável o meu LCD 1600x1200 ao DVI. A imagem cintila, como se o tempo estivesse errado. Mac OS X pode conduzir esta multa LCD no mesmo hardware, por isso parece ser um problema com o driver radeon em 2.6.10. O driver em 2.6.9 é melhor, mas a tela está afligida com uma espécie de estranha neve tecnicolor. Muito irritante. O driver no kernel 2.6.9 pode conduzir o meu LCD 1280x1024 sobre o DVI sem problemas e suponho que seja bom em resoluções mais baixas também. Ainda não teste 2.6.10 com o LCD 1280x1024 ainda. Ferramentas que você precisará: mídia de instalação do Apple Mac OS X (vem com o Mac) Conexão de internet CD-R em branco Bebida de limão fraca O processo a seguir irá apagar o disco rígido interno do seu Mac. Todos os dados sobre isso serão perdidos. Copie qualquer coisa que você valorize para outro computador ou em mídia óptica gravável antes de prosseguir. Quando você recebe seu Mac mini da Apple, ele terá uma única partição para Mac OS X que ocupa todo o disco. Para instalar o Debian, você precisará reservar parte do disco para o sistema de arquivos Debians. Esse processo é chamado de particionamento. Quando repartimos o disco, qualquer sistema de arquivos nele deve ser reformatado (ou re-inicializado no Apple-speak). Se você tiver algum dado valioso no seu Mac, copie-o em algum lugar seguro (de preferência, outro computador) antes de prosseguir. Se você quiser que seu Mac execute apenas o Debian, você pode avançar para gravar o CD de instalação. Se você quiser iniciar o Mac OS X de duas malhas e Debian, continue lendo. Com o Mac OS X em execução, insira o Mac Mac OS X instalado Disco 1 que você recebeu com o seu Mac. Execute o instalador a partir do disco e, quando solicitado, clique no botão Reiniciar. O seu Mac Mini reiniciará (bong) e carregará o instalador do Mac OS X a partir do disco óptico. Se você já iniciou a instalação do OS X, basta reiniciar com o disco na unidade e mantenha pressionada a tecla C do seu teclado - isso forçará o firmware do Mac a tentar inicializar a partir da unidade óptica interna. Com o instalador em execução, abra no menu Instalador no canto superior esquerdo da tela. Escolha Abrir Utilitário de Disco. Você precisará digitar ao Disk Utility como particionar o disco rígido. Pedi cinco partições. A maioria destes eu marcava como espaço livre. Isso está bem, nós voltaremos a atribuir seu propósito no instalador Debian. Disk Utility é um pouco complicado de usar, mas persevera e você vai descobrir o final. Algumas dicas: se você usar o mouse para redimensionar uma partição abaixo de um gigabyte, ele começa a contar em megabytes em vez disso. Isso permite que você digite o tamanho exato que deseja para pequenas partições. Para selecionar uma partição muito pequena para ser visível, clique em outra partição e use a tecla de guia no teclado. Esta tabela mostra como reparei meu disco interno de 80GB. Eu decidi ter uma partição de 8GB que formataria como FAT32. Isso me permite compartilhar facilmente e de forma confiável arquivos entre OS X e Linux, ambos com suporte bom FAT32, mas, no momento da escrita, suporte insuficiente ou incompleto para outros sistemas de arquivos nativos. Sistema de arquivos Mac OS X Uma palavra de cautela: descobri que o Disk Utility às vezes perdia algum espaço, presumivelmente isso é um erro no software. Verifique se os tamanhos das partições aumentam a quantidade certa quando você é redimensionado. E lembre-se de que um disco de 80 gigabytes de marketing contém apenas 74,5 gigabytes reais. Eu tive que sair e reiniciar o Disk Utility várias vezes antes de eu conseguir fazer funcionar o direito. Eu acho que o truque era fazer a última partição primeiro, então comece do primeiro. Depois de concluir, clique no botão Partição, feche o Utilitário de disco e instale o Mac OS X na sua nova partição. Beba sua fraca bebida com limão agora. Eventualmente, o Mac reiniciará no Mac OS X para que você forneça todos os seus dados pessoais à Apple e depois continue com a vida no OS X. Seu computador agora possui algumas partições vazias para o Debian se instalar. Em seguida, você precisará de um CD de instalação Debian. Debian tem vários ramos, vários dos quais estão em desenvolvimento contínuo. Novas versões do software são carregadas no ramo instável. Depois de algumas semanas sem erros sérios encontrados em instáveis. O ramo de teste aceita esses pacotes. Periodicamente, o Debian congela o teste e o libera como um novo ramo estável. Um novo ramo é então criado para se tornar o novo teste. Vou mostrar-lhe como instalar o Sarge, que é o nome do ramo de teste atual. Não é bem o passeio de juntas brancas que o ramo instável é, e, ao contrário do ramo estável, contém um software bastante atualizado. É a escolha inteligente. Heres um esboço do processo: Baixe uma imagem ISO do site da Debian Grave a imagem ISO para um CD-R em branco Reinicie no instalador Debian Instale o sistema base Debian, este é um sistema Debian mínimo com apenas ferramentas suficientes para baixar e instalar qualquer Pacotes adicionais que você precisa Reiniciar no sistema base Debian Selecione os pacotes que você gostaria de usar Baixe e instale os pacotes Crie um kernel otimizado, aproveite o Run Safari e vá para a página Debian Installer. Aqui você pode baixar um arquivo ISO, que é uma imagem do sistema de arquivos pronta para ser queimada em um CD-R em branco. Eu baixei a versão Release Candidate 2 (rc2) do instalador. Se uma versão mais recente estiver disponível, talvez queira tentar isso. Existem muitas imagens de CD diferentes disponíveis. Você quer uma das imagens powerpc. Existem vários tamanhos diferentes disponíveis. Se você se conectar à Internet através da sua porta Ethernet Macs, o Id recomenda a imagem do CD do cartão de visita. Que é de cerca de 110MB. Isso contém o suficiente para instalar o sistema base sem mais downloads. Se você não se importar em baixar muito, ou se você se conectar à Internet através do modem interno dos Macs, pode ser uma idéia melhor para baixar o conjunto de CD completo, uma vez que estes incluem um instantâneo dos pacotes mais populares. Não se preocupe com 14 () CDs, eles são organizados com o software mais popular nos CDs com pouca numeração. Você pode obter um sistema de trabalho com apenas CD 1, eu acredito. Cada CD completo é de cerca de 650MB. Uma vez que você tenha um ISO adorável, você vai querer gravá-lo em CD. Você não pode apenas gravá-lo como um arquivo em um CD, o arquivo é em si uma imagem de um sistema de arquivos de CD (iso9660). Abra a pasta Aplicativos, depois a pasta Utilitários e execute o Utilitário de disco novamente. Às vezes, parece que este é o único aplicativo do OS X que já executei. De qualquer forma, no menu Imagens, selecione Abrir. Encontre seu arquivo ISO e abra-o. Clique na imagem ISO e depois clique no botão Gravar na barra de ferramentas. Alimente o seu Mac Mini um CD-R em branco e tome um pouco de bebida fraca de limão agora. Antes de reiniciar, você pode querer exibir o manual de instalação do Sarge para o PowerPC. Estavam prestes a iniciar o Capítulo 5. Reinicie ou ligue a sua máquina. Antes do bong, mantenha pressionada a tecla C. O bootstrap no CD Debian deve ser carregado. Se você acabar no OS X, tente novamente. Na inicialização: prompt, apenas pressione enter. O kernel será inicializado. Após alguns segundos, o instalador começará e serão feitas algumas perguntas simples. Idealmente, você estaria conectado à Internet através da porta Mac Minis ethernet, caso em que você pode dizer ao instalador que use eth0 como a principal interface de rede. Depois de baixar as listas de pacotes do seu arquivo Debian local, o instalador iniciará a ferramenta de particionamento. Nós já dividimos nosso disco, mas precisamos usar a ferramenta para definir os tipos de partição corretos. Quando solicitado, escolha Editar manualmente a tabela de partição. Se você seguiu o meu cinco planos de partição anteriormente, é para isso que você deseja acabar com: Não toque na pequena Partição 1 no início do disco, que contém o próprio mapa de partição. Partição 2 (16MB) é para o yaboot, o bootstrap que permite arrancar Linux ou MacOS. Você deseja que o particionador use essa partição como uma partição de inicialização do NewWorld e configure o sinalizador inicializável. Partição 3 (2.0GB) deve ser usada como área de troca. A Partição 4 (48.0GB) é o seu sistema de arquivos raiz, você deseja usar isso como um sistema de arquivos ReiserFS Journal, formatá-lo e montá-lo. Partição 5 (8.7GB) é usado como um sistema de arquivos FAT32, Ive montou a mina em compartilhado. Não há partição 6 Partição 7 (21.3GB) é o sistema de arquivos Mac OS Xs. Não toque. Quando você estiver pronto, selecione Finalizar particionamento e escrever alterações no disco. Para mim, o instalador reclamou que a partição FAT32 tinha erros. Eu acho que isso significa que ele não poderia formatá-lo, presumivelmente porque está faltando mkfs. vfat. Não entre em pânico, apenas continue com a instalação - é um problema simples para corrigir mais tarde. O Debian agora instalará um sistema base. Este é um sistema com ferramentas suficientes para começar, conectar-se à Internet e baixar qualquer software adicional que você precisa. Este passo demora alguns minutos, então por que não aproveitar esta vez para aproveitar a bebida refrescante e fraca de limão. Eventualmente, seu Mac cuspira o CD de instalação do Debian e reiniciará. Em vez de reiniciar diretamente no Mac OS X como antes, ele agora carregará um bootstrap a partir do qual você pode acertar a letra L para inicializar Linux ou X para iniciar o Mac OS X. Toque L e, no prompt boot :, a tecla Enter . O Debian irá inicializar e agora você pode completar sua instalação. O manual de instalação do Sarge irá guiá-lo através do resto do processo de instalação, o que é indolor. Se você estiver seguindo, comece no Capítulo 7.2. Se você deseja construir seu próprio kernel, aqui está o meu kernel. config para 2.6.9. Que você pode achar útil. Construir um novo kernel é muito rápido e simples com as ferramentas Debian, basta instalar o kernel-package e seguir a documentação. Uma vez que você instalou o sistema base, você pode instalar facilmente o mesmo software em seu Mac Mini conforme você usa em outro sistema Debian: Use dpkg --get-selections selections. txt no seu sistema atual. Copie o arquivo selections. txt para o seu Mac Mini. Execute dpkg --set-selectionshtop explicado Explicação de tudo o que você pode ver no htoptop no Linux Última atualização em 2 de janeiro de 2017 1 no Hacker News em 2 de dezembro de 2016 1 no rsysadmin em 2 de dezembro de 2016 2 no rlinux em 2 de dezembro de 2016 Durante o maior tempo, não sabia o que tudo significava no htop. Eu pensei que a média de carga 1.0 na minha máquina de dois núcleos significa que o uso da CPU está em 50. Isso não é bastante correto. E também, por que diz 1,0 eu decidi olhar tudo e documentá-lo aqui. Eles também dizem que a melhor maneira de aprender algo é tentar ensiná-lo. Índice htop no Ubuntu Server 16.04 x64 Aqui está uma captura de tela do htop que vou descrever. Uptime mostra quanto tempo o sistema está funcionando. Você pode ver a mesma informação executando o tempo de atividade: como o programa de tempo de atividade sabe que lê as informações do arquivo procuptime. O primeiro número é o número total de segundos em que o sistema foi ativado. O segundo número é quanto desse tempo a máquina passou ocioso, em segundos. O segundo valor pode ser maior do que o tempo total de funcionamento do sistema em sistemas com múltiplos núcleos, uma vez que é uma soma. Como eu sabia que eu olhei para quais arquivos o programa de tempo de atividade abre quando ele é executado. Podemos usar a ferramenta Strace para fazer isso. Haverá muitos resultados. Nós podemos grep para a chamada de sistema aberta. Mas isso realmente não funcionará, uma vez que Strace produz tudo para o fluxo de erro padrão (stderr). Podemos redirecionar o stderr para o fluxo de saída padrão (stdout) com 2gtamp1. Nossa saída é esta: que contém o arquivo procuptime que mencionei. Acontece que você também pode usar strace - e abrir o tempo de atividade e não incomodar com a covarde. Então, por que precisamos do programa de tempo de atividade se pudermos apenas ler o conteúdo do arquivo. O tempo de atividade está bem formatado para humanos, enquanto o número de segundos é mais útil para usar em seus próprios programas ou scripts. Além do tempo de atividade, houve também três números que representam a média de carga. Eles são retirados do arquivo procloadavg. Se você dar uma nova olhada na saída do Strace, você verá que esse arquivo também foi aberto. As primeiras três colunas representam a carga média do sistema nos últimos períodos de 1, 5 e 15 minutos. A quarta coluna mostra o número de processos atualmente em execução e o número total de processos. A última coluna exibe o último ID do processo usado. Let39s começam com o último número. Sempre que você inicia um novo processo, é atribuído um número de identificação. As IDs de processo geralmente estão aumentando, a menos que tenham sido exaustados e estão sendo reutilizados. O ID do processo 1 pertence ao sbininit que é iniciado no momento da inicialização. Vamos ver o conteúdo procloadavg novamente e, em seguida, iniciar o comando sleep em segundo plano. Quando é iniciado em segundo plano, o ID do processo será mostrado. Então, o 1123 significa que há um processo em execução ou pronto para ser executado neste momento e 123 são processados ​​no total. Quando você executa o htop e vê apenas um processo em execução, isso significa que é o próprio processo do htop. Se você executar o sono 30 e executar o htop novamente, você notará que ainda existe apenas 1 processo de execução. Isso porque o sono não está funcionando, está dormindo ou está em marcha lenta ou, em outras palavras, esperando que algo aconteça. Um processo em execução é um processo que está atualmente sendo executado na CPU física ou aguardando sua vez de ser executado na CPU. Se você executar o devurandom gt devnull que gera repetidamente bytes aleatórios e os grava em um arquivo especial que nunca é lido, você verá que existem agora dois processos em execução. Portanto, agora existem dois processos em execução (geração de números aleatórios e o gato que lê o conteúdo do procloadavg) e você também notou que as médias da carga aumentaram. A média de carga representa a carga média do sistema ao longo de um período de tempo. O número da carga é calculado contando o número de execução (atualmente em execução ou aguardando a execução) e processos ininterruptos (esperando por disco ou atividade de rede). Então é simplesmente uma série de processos. As médias de carga são então o número médio desses processos durante os últimos 1, 5 e 15 minutos, certo. Acontece que não é tão simples quanto isso. A média de carga é a média móvel amortizada exponencialmente do número da carga. Da Wikipédia: Matemática, os três valores sempre média toda a carga do sistema desde o início do sistema. Todos eles se deterioram exponencialmente, mas eles se deterioram a uma velocidade diferente. Assim, a média de carga de 1 minuto somará 63 da carga do último minuto, mais 37 da carga desde o início, excluindo o último minuto. Portanto, não é tecnicamente preciso que a média de carga de 1 minuto inclua apenas a atividade dos últimos 60 segundos (uma vez que ainda inclui 37 atividades do passado), mas isso inclui principalmente o último minuto. É isso que você esperava que os Estados Unidos retornassem à nossa geração de números aleatórios. Embora tecnicamente não correto, é assim que simplifico as médias de carga para facilitar a raciocínio sobre elas. Neste caso, o processo de geração de números aleatórios é ligado à CPU, de modo que a média de carga no último minuto é 1,00 ou, em média, 1 processo de execução. Uma vez que existe apenas uma CPU no meu sistema, a utilização da CPU é 100, pois minha CPU pode executar apenas um processo por vez. Se eu tivesse dois núcleos, o uso da CPU seria 50, pois meu computador pode executar dois processos ao mesmo tempo. A média de carga de um computador com 2 núcleos que tenha uma utilização de 100 CPU seria 2,00. Você pode ver o número de seus núcleos ou CPUs no canto superior esquerdo do htop ou executando nproc. Como o número de carga também inclui processos em estados ininterruptos que não têm muito efeito na utilização da CPU, não é correto inferir o uso da CPU a partir de médias de carga como acabei de fazer. Isso também explica por que você pode ver médias de alta carga, mas não muita carga na CPU. Mas existem ferramentas como mpstat que podem mostrar a utilização instantânea da CPU. Por que usamos médias de carga, então, no canto superior direito, htop mostra o número total de processos e quantos deles estão sendo executados. Mas diz Tarefas não processos. Por que outro nome para um processo é uma tarefa. O kernel do Linux refere-se internamente a processos como tarefas. Htop usa Tarefas em vez de Processos provavelmente porque é mais curto e economiza espaço na tela. Você também pode ver os tópicos no htop. Para alternar a visibilidade dos tópicos, pressione Shift H no seu teclado. Se você ver tarefas: 23, 10 thr. Isso significa que eles são visíveis. Você também pode ver os segmentos do kernel com o Shift K. Quando eles estiverem visíveis, eles dirão Tarefas: 23, 40 kthr. PID ID de processo Cada vez que um novo processo é iniciado, é atribuído um número de identificação (ID) que é chamado ID de processo ou PID para breve. Se você executar um programa em segundo plano (amp) do bash. Você verá o número do trabalho entre colchetes e o PID. Se você perdeu, você pode usar a variável no bash que se expandirá para o último ID do processo em background. O ID do processo é muito útil. Pode ser usado para ver detalhes sobre o processo e controlá-lo. Procfs é um sistema de arquivos pseudo que permite que os programas do userland obtenham informações do kernel lendo arquivos. Geralmente é montado no proc e para você parece um diretório regular que você pode navegar com ls e cd. Todas as informações relacionadas a um processo estão localizadas em procltpidgt. Por exemplo, procltpidgtcmdline dará o comando que foi usado para iniciar o processo. Ugh, isso não está certo. Acontece que o comando está separado pelo 0 byte. Que podemos substituir por um espaço ou uma nova linha. O diretório do processo para um processo pode conter links. Por exemplo, os pontos cwd para o diretório de trabalho atual e exe são o binário executado. Então é assim que htop. topo. Ps e outros utilitários de diagnóstico obtêm suas informações sobre os detalhes de um processo: eles o lêem de procltpidgtltfilegt. Quando você inicia um novo processo, o processo que lançou o novo processo é chamado de processo pai. O novo processo agora é um processo filho para o processo pai. Esses relacionamentos formam uma estrutura em árvore. Se você atingiu F5 no htop. Você pode ver a hierarquia do processo. Você também pode usar o interruptor f com ps Se você já se perguntou por que você geralmente vê bash ou sshd como pais de alguns de seus processos, aqui é o motivo. Isto é o que acontece quando você corre, digamos, data do seu shell bash: bash cria um novo processo que é uma cópia de si mesmo (usando uma chamada do sistema fork), ele carregará o programa a partir do arquivo executável se liga na memória (usando um Chamada de sistema exec) bash, pois o processo pai aguardará a saída do filho. Então, o sbininit com uma ID de 1 foi iniciado no arranque, o que gerou o SSD daemon sshd. Quando você se conecta ao computador, o sshd gerará um processo para a sessão, que por sua vez iniciará o shell bash. Eu gosto de usar essa exibição de árvore no htop quando eu também estou interessado em ver todos os tópicos. Cada processo é de propriedade de um usuário. Os usuários são representados com uma identificação numérica. Você pode usar o comando id para descobrir o nome desse usuário. Acontece que essa ID obtém essa informação dos arquivos etcpasswd e etcgroup. Isso porque o arquivo de configuração do NSF (Name Service Switch), etc., nsswitch. conf diz usar esses arquivos para resolver nomes. O valor de compat (modo de compatibilidade) é o mesmo que os arquivos, exceto que outras entradas especiais são permitidas. Arquivos significa que o banco de dados é armazenado em um arquivo (carregado por libnssfiles. so). Mas você também pode armazenar seus usuários em outros bancos de dados e serviços ou usar Lightweight Directory Access Protocol (LDAP), por exemplo. Etcpasswd e etcgroup são arquivos de texto simples que mapeiam IDs numéricos para nomes legíveis para humanos. Passwd. Mas, onde estão as senhas, eles estão realmente em etcshadow. What39s that gibberish 6 is the password hashing algorithm used, in this case it stands for sha512 followed by randomly generated salt to safeguard against rainbow table attacks and finally the hash of your password salt When you run a program, it will be run as your user. Even if the executable file is not owned by you. If you39d like to run a program as root or another user, that39s what sudo is for. But what if you want to log in as another user to launch various commands Use sudo bash or sudo - u user bash. You39ll be able to use the shell as that user. If you don39t like being asked for the root password all the time, you can simply disable it by adding your user to the etcsudoers file. Right, only root can do it. What happens here is that you are executing the echo command as root but appending the line to the etcsudoers file still as your user. There are usually two ways around it: echo quotUSER ALL(ALL) NOPASSWD: ALLquot sudo tee - a etcsudoers sudo bash - c quotecho 39USER ALL(ALL) NOPASSWD: ALL39 gtgt etcsudoersquot In the first case, tee - a will append its standard input to the file and we execute this command as root. In the second case, we run bash as root and ask it to execute a command ( - c ) and the entire command will be executed as root. Note the tricky quot 39 business here which will dictate when the USER variable will be expanded. If you take a look at the etcsudoers file you will see that it begins with It39s a helpful warning that says you should edit this file with sudo visudo. It will validate the contents of the file before saving and prevent you from making mistakes. If you don39t use visudo and make a mistake, it may lock you out from sudo. Which means that you won39t be able to correct your mistake Let39s say you want to change your password. You can do it with the passwd command. It will, as we saw earlier, save the password to the etcshadow file. This file is sensitive and only writeable by root: So how is it possible that the passwd program which is executed by a regular user can write to a protected file I said earlier that when you launch a process, it is owned by you, even if the owner of the executable file is another user. It turns out that you can change that behavior by changing file permissions. Let39s take a look. Notice the s letter. It was accomplished with sudo chmod us usrbinpasswd. It means that an executable will be launched as the the owner of the file which is root in this case. You can find the so called setuid executables with find bin - user root - perm - us . Note that you can also do the same with group ( gs ). We are next going to look at the process state column in htop which is denoted simply with the letter S . Here are the possible values: I39ve ordered them by how often I see them. Note that when you run ps. it will also show substates like Ss. R. Ss. etc. R - running or runnable (on run queue) In this state, the process is currently running or on a run queue waiting to run. What does it mean to run When you compile the source code of a program that you39ve written, that machine code is CPU instructions. It is saved to a file that can be executed. When you launch a program, it is loaded into memory and then the CPU executes these instructions. Basically it means that the CPU is physically executing instructions. Or, in other words, crunching numbers. S - interruptible sleep (waiting for an event to complete) This means that the code instructions of this process are not being executed on the CPU. Instead, this process is waiting for something - an event or a condition - to happen. When an event happens, the kernel sets the state to running. One example is the sleep utily from coreutils. It will sleep for a specific number of seconds (approximately). So this is interruptible sleep. How can we interrupt it By sending a signal. You can send a signal in htop by hitting F9 and then choosing one of the signals in the menu on the left. Sending a signal is also known as kill. That39s because kill is a system call that can send a signal to a process. There is a program binkill that can make this system call from userland and the default signal to use is TERM which will ask the process to terminate or in other words try to kill it. Signal is just a number. Numbers are hard to remember so we give them names. Signal names are usually written in uppercase and may be prefixed with SIG. Some commonly used signals are INT. KILL. STOP. CONT. HUP . Let39s interrupt the sleep process by sending the INT aka SIGINT aka 2 aka Terminal interrupt signal. This is also what happens When you hit CTRL C on your keyboard. bash will the send the foreground process the SIGINT signal just like we just did manually. By the way, in bash. kill is a built-in command, even though there is binkill on most systems. Why It allows processes to be killed if the limit on processes that you can create is reached. These commands do the same thing: kill - INT 10089 kill -2 10089 binkill -2 10089 Another useful signal to know is SIGKILL aka 9. You may have used it to kill a process that didn39t respond to your frantic CTRL C keyboard presses. When you write a program, you can set up signal handlers that are functions that will be called when your process receives a signal. In other words, you can catch the signal and then do something, for example, clean up and shut down gracefully. So sending SIGINT (the user wants to interrupt a process) and SIGTERM (the user wants to terminate the process) does not mean that the process will be terminated. You may have seen this exception when running Python scripts: You can tell the kernel to forcefully terminate a process and not give it a change to respond by sending the KILL signal: D - uninterruptible sleep (usually IO) Unlike interruptible sleep, you cannot wake up this process with a signal. That is why many people dread seeing this state. You can39t kill such processes because killing means sending SIGKILL signals to processes. This state is used if the process must wait without interruption or when the event is expected to occur quickly. Like reading tofrom a disk. But that should only happen for a fraction of a second. Uninterruptable processes are USUALLY waiting for IO following a page fault. The processtask cannot be interrupted in this state, because it can39t handle any signals if it did, another page fault would happen and it would be back where it was. In other words, this could happen if you are using Network File System (NFS) and it takes a while to read and write from it. Or in my experience it can also mean that some of the processes are swapping a lot which means you have too little available memory. Let39s try to get a process to go into uninterruptible sleep. 8.8.8.8 is a public DNS server provided by Google. They do not have an open NFS on there. But that won39t stop us. How to find out what39s causing this strace Let39s strace the command in the output of ps above. So the mount system call is blocking the process. If you39re wondering, you can run mount with an intr option to run as interruptible: sudo mount 8.8.8.8:tmp tmp - o intr . Z - defunct (quotzombiequot) process, terminated but not reaped by its parent When a process ends via exit and it still has child processes, the child processes become zombie processes. If zombie processes exist for a short time, it is perfectly normal Zombie processes that exist for a long time may indicate a bug in a program Zombie processes don39t consume memory, just a process ID You can39t kill a zombie process You can ask nicely the parent process to reap the zombies (the SIGCHLD signal) You can kill the zombie39s parent process to get rid of the parent and its zombies I am going to write some C code to show this. Here is our program. Let39s install the GNU C Compiler (GCC). Compile it and then run it Look at the process tree We got our zombie When the parent process is done, the zombie is gone. If you replaced sleep(20) with while (true) then the zombie would be gone right away. With exit. all of the memory and resources associated with it are deallocated so they can be used by other processes. Why keep the zombie processes around then The parent process has the option to find out its child process exit code (in a signal handler) with the wait system call. If a process is sleeping, then it needs to wait for it to wake up. Why not simply forcefully wake it up and kill it For the same reason, you don39t toss your child in the trash when you39re tired of it. Bad things could happen. T - stopped by job control signal I have opened two terminal windows and I can look at my user39s processes with ps u . I will omit the - bash and ps u processes from the output below. Now run cat devurandom gt devnull in one terminal window. Its state is R which means that it is running. Press CTRL Z to stop the process. Its state is now T . Run fg in the first terminal to resume it. Another way to stop a process like this is to send the STOP signal with kill to the process. To resume the execution of the process, you can use the CONT signal. t - stopped by debugger during the tracing First, install the GNU Debugger (gdb) Run a program that will listen for incoming network connections on port 1234. It is sleeping meaning it is waiting for data from the network. Run the debugger and attach it to the process with ID 3905 . You will see that the state is t which means that this process is being traced in the debugger. Linux is a multitasking operating system which means that even when you have a single CPU, you can run several processes at the same time. You can connect to your server via SSH and look at the output of htop while your web server is delivering the content of your blog to your readers over the internet. How is that possible when a single CPU can only execute one instruction at a time The answer is time sharing. One process runs for a bit of time, then it is suspended while the other processes waiting to run take turns running for a while. The bit of time a process runs is called the time slice. The time slice is usually a few milliseconds so you don39t really notice it that much when your system is not under high load. (It39d be really interesting to find out how long time slices usually are in Linux.) This should help explain why the load average is the average number of running processes. If you have just one core and the load average is 1.0. the CPU has been utilized at 100. If the load average is higher than 1.0. it means that the number of processes wanting to run is higher than the CPU can run so you may experience slow downs or delays. If the load is lower than 1.0. it means the CPU is sometimes idleing and not doing anything. This should also give you a clue why sometimes the running time of a process that39s been running for 10 seconds is higher or lower than exactly 10 seconds. Process niceness and priority When you have more tasks to run than the number of available CPU cores, you somehow have to decide which tasks to run next and which ones to keep waiting. This is what the task scheduler is responsible for. The scheduler in the Linux kernel is reponsible for choosing which process on a run queue to pick next and it depends on the scheduler algorithm used in the kernel. You can39t generally influence the scheduler but you can let it know which processes are more important to you and the scheduler may take it into account. Niceness ( NI ) is user-space priority to processes, ranging from -20 which is the highest priority to 19 which is the lowest priority. It can be confusing but you can think that a nice process yields to a less nice process. So the nicer a process is, the more it yields. From what I39ve pieced together by reading StackOverflow and other sites, a niceness level increase by 1 should yield a 10 more CPU time to the process. The priority ( PRI ) is the kernel-space priority that the Linux kernel is using. Priorities range from 0 to 139 and the range from 0 to 99 is real time and 100 to 139 for users. You can change the nicesness and the kernel takes it into account but you cannot change the priority. The relation between the nice value and priority is: so the value of PR 20 (-20 to 19) is 0 to 39 that maps 100 to 139. You can set the niceness of a process before launching it. Change the nicencess when a program is already running with renice . Here is what the CPU usage colors mean: Blue: Low priority threads (nice gt 0) Green: Normal priority threads Red: Kernel threads Memory usage - VIRTRESSHRMEM A process has the illusion of being the only one in memory. This is accomplished by using virtual memory. A process does not have direct access to the physical memory. Instead, it has its own virtual address space and the kernel translates the virtual memory addresses to physical memory or can map some of it to disk. This is why it can look like processes use more memory than you have installed on your computer. The point I want to make here is that it is not very straightforward to figure out how much memory a process takes up. Do you also want to count the shared libraries or disk mapped memory But the kernel provides and htop shows some information that can help you estimate memory usage. Here is what the memory usage colors mean: Green: Used memory Blue: Buffers Orange: Cache VIRTVSZ - Virtual Image The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have been swapped out and pages that have been mapped but not used. VIRT is virtual memory usage. It includes everything, including memory mapped files. If an application requests 1 GB of memory but uses only 1 MB, then VIRT will report 1 GB. If it mmap s a 1 GB file and never uses it, VIRT will also report 1 GB. Most of the time, this is not a useful number. RESRSS - Resident size The non-swapped physical memory a task has used. RES is resident memory usage i. e. what39s currently in the physical memory. While RES can be a better indicator of how much memory a process is using than VIRT. keep in mind that this does not include the swapped out memory some of the memory may be shared with other processes If a process uses 1 GB of memory and it calls fork(). the result of forking will be two processes whose RES is both 1 GB but only 1 GB will actually be used since Linux uses copy-on-write. SHR - Shared Mem size The amount of shared memory used by a task. It simply reflects memory that could be potentially shared with other processes. TODO: I should finish this. MEM - Memory usage A task39s currently used share of available physical memory. This is RES divided by the total RAM you have. If RES is 400M and you have 8 gigabytes of RAM, MEM will be 4008192100 4.88. I launched a Digital Ocean droplet with Ubuntu Server. What are the processes that are started at boot Do you actually need them Here are my research notes on the processes that are run at startup on a fresh Digital Ocean droplet with Ubuntu Server 16.04.1 LTS x64. The sbininit program (also called init) coordinates the rest of the boot process and configures the environment for the user. When the init command starts, it becomes the parent or grandparent of all of the processes that start up automatically on the system. What happens if you kill it systemd-journald is a system service that collects and stores logging data. It creates and maintains structured, indexed journals based on logging information that is received from a variety of sources. One of the main changes in journald was to replace simple plain text log files with a special file format optimized for log messages. This file format allows system administrators to access relevant messages more efficiently. It also brings some of the power of database-driven centralized logging implementations to individual systems. You are supposed to use the journalctl command to query log files. journalctl COMMsshd logs by sshd journalctl COMMsshd - o json-pretty logs by sshd in JSON journalctl --since quot2015-01-10quot --until quot2015-01-11 03:00quot journalctl --since 09:00 --until quot1 hour agoquot journalctl --since yesterday journalctl - b logs since boot journalctl - f to follow logs journalctl --disk-usage journalctl --vacuum-size1G It looks like it is not possible to remove or disable this service, you can only turn off logging. The lvmetad daemon caches LVM metadata, so that LVM commands can read metadata without scanning disks. Metadata caching can be an advantage because scanning disks is time consuming and may interfere with the normal work of the system and disks. But what is LVM (Logical Volume Management) You can think of LVM as quotdynamic partitionsquot, meaning that you can createresizedelete LVM quotpartitionsquot (they39re called quotLogical Volumesquot in LVM-speak) from the command line while your Linux system is running: no need to reboot the system to make the kernel aware of the newly-created or resized partitions. It sounds like you should keep it if you are using LVM. systemd-udevd listens to kernel uevents. For every event, systemd-udevd executes matching instructions specified in udev rules. udev is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the dev directory. So this service manages dev. I am not sure if I need it running on a virtual server. systemd-timesyncd is a system service that may be used to synchronize the local system clock with a remote Network Time Protocol server. So this replaces ntpd . If we take a look at the open ports on this server: Previously on Ubuntu 14.04 it was atd - run jobs queued for later execution. atd runs jobs queued by at. at and batch read commands from standard input or a specified file which are to be executed at a later time Unlike cron, which schedules jobs that are repeated periodically, at runs a job at a specific time once. I39ve actually never used it until now. Snappy Ubuntu Core is a new rendition of Ubuntu with transactional updates - a minimal server image with the same libraries as todays Ubuntu, but applications are provided through a simpler mechanism. Developers from multiple Linux distributions and companies today announced collaboration on the snap universal Linux package format, enabling a single binary package to work perfectly and securely on any Linux desktop, server, cloud or device. Apparently it is a simplified deb package and you39re supposted to bundle all dependencies in a single snap that you can distribute. I39ve never used snappy to deploy or distribute applications on servers. In computing, D-Bus or DBus is an inter-process communication (IPC) and remote procedure call (RPC) mechanism that allows communication between multiple computer programs (that is, processes) concurrently running on the same machine My understanding is that you need it for desktop environments but on a server to run web apps I wonder what time it is and whether it is being synchronized with NTP Oops. Should probably keep this. systemd-logind is a system service that manages user logins. cron - daemon to execute scheduled commands (Vixie Cron) - f Stay in foreground mode, don39t daemonize. You can schedule tasks to run periodically with cron. Use crontab - e to edit the configuration for your user or on Ubuntu I tend to use the etccron. hourly. etccron. daily. etc. directories. You can see the log files with grep cron varlogsyslog or journalctl COMMcron or even journalctl COMMcron --sincequotdatequot --untilquotdatequot You39ll probably want to keep cron. But if you don39t, then you should stop and disable the service: Because otherwise when trying to remove it with apt remove cron it will try to install postfix It looks like cron needs a mail transport agent (MTA) to send emails. Rsyslogd is a system utility providing support for message logging. In another words, it39s what populates log files in varlog like varlogauth. log for authentication messages like SSH login attempts. The configuration files are in etcrsyslog. d . You can also configure rsyslogd to send log files to a remote server and implement centralized logging. You can use the logger command to log messages to varlogsyslog in background scripts such as those that are run at boot. Right, but we already have systemd-journald running. Do we need rsyslogd as well Rsyslog and Journal, the two logging applications present on your system, have several distinctive features that make them suitable for specific use cases. In many situations it is useful to combine their capabilities, for example to create structured messages and store them in a file database. A communication interface needed for this cooperation is provided by input and output modules on the side of Rsyslog and by the Journal39s communication socket. So, maybe I am going to keep it just in case. acpid - Advanced Configuration and Power Interface event daemon acpid is designed to notify user-space programs of ACPI events. acpid should be started during the system boot, and will run as a background process, by default. In computing, the Advanced Configuration and Power Interface (ACPI) specification provides an open standard that operating systems can use to perform discovery and configuration of computer hardware components, to perform power management by, for example, putting unused components to sleep, and to do status monitoring. But I39m on a virtual server that I don39t intend to suspendresume. I am going to remove it for fun and see what happens. I was able to successfully reboot the droplet but after halt Digital Ocean thought it was still on so I had to Power Off using the web interface. So I should probably keep this. Lxcfs is a fuse filesystem mainly designed for use by lxc containers. On a Ubuntu 15.04 system, it will be used by default to provide two things: first, a virtualized view of some proc files and secondly, filtered access to the hosts cgroup filesystems. In summary, on a 15.04 host, you can now create a container the usual way, lxc-create. The resulting container will have correct results for uptime, top, etc. Its basically a userspace workaround to changes which were deemed unreasonable to do in the kernel. It makes containers feel much more like separate systems than they would without it. Not using LXC containers You can remove it with The AccountsService package provides a set of D-Bus interfaces for querying and manipulating user account information and an implementation of these interfaces based on the usermod(8), useradd(8) and userdel(8) commands. When I removed DBus it broke timedatectl. I wonder what removing this service will break. mdadm is a Linux utility used to manage and monitor software RAID devices. The name is derived from the md (multiple device) device nodes it administers or manages, and it replaced a previous utility mdctl. The original name was quotMirror Diskquot, but was changed as the functionality increased. RAID is a method of using multiple hard drives to act as one. There are two purposes of RAID: 1) Expand drive capacity: RAID 0. If you have 2 x 500 GB HDD then total space become 1 TB. 2) Prevent data loss in case of drive failure: For example RAID 1, RAID 5, RAID 6, and RAID 10. You can remove it with polkitd PolicyKit daemon polkit - Authorization Framework My understanding is that this is like fine-grained sudo. You can allow non privilegded users to do certain actions as root. For instance, reboot your computer when you39re running Linux on a desktop computer. But I39m running a server. You can remove it with Still wondering if this breaks something. sshd (OpenSSH Daemon) is the daemon program for ssh. - D When this option is specified, sshd will not detach and does not become a daemon. This allows easy monitoring of sshd. iscsid is the daemon (system service) that runs in the background, acting on iSCSI configuration, and managing the connections. From its manpage: The iscsid implements the control path of iSCSI protocol, plus some management facilities. For example, the daemon could be configured to automatically re-start discovery at startup, based on the contents of persistent iSCSI database. I had never heard of iSCSI: In computing, iSCSI (Listeniaskzi eye-skuz-ee) is an acronym for Internet Small Computer Systems Interface, an Internet Protocol (IP)-based storage networking standard for linking data storage facilities. By carrying SCSI commands over IP networks, iSCSI is used to facilitate data transfers over intranets and to manage storage over long distances. iSCSI can be used to transmit data over local area networks (LANs), wide area networks (WANs), or the Internet and can enable location-independent data storage and retrieval. The protocol allows clients (called initiators) to send SCSI commands (CDBs) to SCSI storage devices (targets) on remote servers. It is a storage area network (SAN) protocol, allowing organizations to consolidate storage into data center storage arrays while providing hosts (such as database and web servers) with the illusion of locally attached disks. You can remove it with sbinagetty --noclear tty1 linux agetty - alternative Linux getty getty, short for quotget ttyquot, is a Unix program running on a host computer that manages physical or virtual terminals (TTYs). When it detects a connection, it prompts for a username and runs the 39login39 program to authenticate the user. Originally, on traditional Unix systems, getty handled connections to serial terminals (often Teletype machines) connected to a host computer. The tty part of the name stands for Teletype, but has come to mean any type of text terminal. This allows you to log in when you are physically at the server. In Digital Ocean, you can click on Console in the droplet details and you will be able to interact with this terminal in your browser (it39s a VNC connection I think). In the old days, you39d see a bunch of ttys started a system boot (configured in etcinittab ), but nowadays they are spun up on demand by systemd. For fun, I removed this configuration file that launches and generates agetty : When I rebooted the server, I could still connect to it via SSH but I was no longer able to log in from the Digital Ocean web console. sshd: rootpts0 amp - bash amp htop sshd: rootpts0 means that there has been an SSH session established for the user root at the 0 pseudoterminal ( pts ). A pseudoterminal emulates a real text terminal. bash is the shell that I am using. Why is there a dash at the beginning Reddit user hirnbrot helpfully explained it: There39s a dash at the beginning because launching it as quot-bashquot will make it a login shell. A login shell is one whose first character of argument zero is a -, or one started with the --login option. This will then cause it to read a different set of configuration files. htop is an interactive process viewer tool that is running in the screenshot. Sometimes looking at strace is not enough. Another way to figure out what a program does is to look at its source code. First, I need to find out where to start looking. Here we find out that uptime is actually located at usrbinuptime and that on Ubuntu it is part of the procps package. You can then go to packages. ubuntu and search for the package there. If you scroll to the bottom of the page, you39ll see links to the source code repositories: Debian Package Source Repository git:git. debian. orgcollab-maintprocps. git Debian Package Source Repository (Browsable) anonscm. debian. orgcgitcollab-maintprocps. git File descriptors and redirection When you want to redirect standard error (stderr) to standard output (stdout), is it 2ampgt1 or 2gtamp1 You can memorize where the ampersand amp goes by knowing that echo something gt file will write something to the file file. It39s the same as echo something 1gt file. Now, echo something 2gt file will write the stderr output to file . If you write echo something 2gt1. it means that you redirect stderr to a file with the name 1. Add spaces to make it more clear: echo something 2gt 1. If you add amp before 1. it means that 1 is not a filename but the stream ID. So it39s echo something 2gtamp1 . Colors in PuTTY If you have missing elements in htop when you are using PuTTY, here is how to solve it. Right click on the title bar Click Change settings. Go to Window - gt Colours Select the Both radio button Click Apply Let39s write a very simple shell in C that demonstrates the use of fork exec wait system calls. Here39s the program shell. c . Compile the program. Have you ever wondered that when you launch a process in the background you only see that it has exited only after a while when you hit Enter That39s because the shell is waiting for your input. Only when you enter a command does it check for the status of the background processes and show if they39ve been terminated. Here is what I39d like to find out more about. process state substatuses ( Ss. Ss. R. etc.) kernel threads devpts more about memory ( CODE. DATA. SWAP ) figure out time slices length Linux scheduler algorithm pinning proceses to cores write about manual pages cpumemory colors in bars process ID limit amp fork bomb lsof. ionice. schedtool Here is a list of non-minor corrections and updates since the post was published. Idle time in procuptime is the sum of all cores (Dec 2, 2016) My parentchild printf in zombie. c was reversed (Dec 2, 2016) apt remove cron installs postfix because of a dependency to an MTA (Dec 3, 2016) id can load information from other sources (via etcnsswitch. conf ), not just etcpasswd (Dec 3, 2016) Describe etcshadow password hash format (Dec 3, 2016) Use visudo to edit the etcsudoers file to be safe (Dec 3, 2016) Explain MEM (Dec 3, 2016) Rewrite the section about load averages (Dec 4, 2016) Fix: kill 1234 by default sends TERM not INT (Dec 7, 2016) Explain CPU and memory color bars (Dec 7, 2016) Please let me know if there is something wrong in this post I will gladly correct it. Related posts Recent posts

No comments:

Post a Comment