AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / user-581126

DenisZ's questions

Martin Hope
DenisZ
Asked: 2021-05-31 05:08:57 +0800 CST

Como criar um serviço personalizado no systemd?

  • 0

Executando o Fedora 33/34 em várias máquinas. Eu ativei com sucesso, o rc-local.serviceque funciona bem. Eu tenho alguns outros scripts que preciso executar /etc/init.d/e criei arquivos de serviço semelhantes como rc-local.service, mas não posso habilitá-lo, enquanto o rc-local.service pode ser habilitado/desabilitado/estrelado/parado sem problemas.
Eu sei que tenho uma opção (que uso atualmente) para chamar esses scripts do rc.localarquivo, mas prefiro chamá-los separadamente como serviço. Então meu arquivo de serviço fica assim:
#cat net-scr1.service

[Unit]
Description=Network check service
ConditionFileIsExecutable=/etc/init.d/net-scr1
After=network.target 

[Service]
Type=forking
ExecStart=/etc/init.d/net-scr1 start
TimeoutSec=3
ExecStop=/etc/init.d/net-scr1 stop
RemainAfterExit=yes
GuessMainPID=no
StandardOutput=tty

[Install]
 WantedBy=multi-user.target

systemctl enable net-scr1

Synchronizing state of net-scr1.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable net-scr1
service net-scr1 does not support chkconfig

Mudei o script init.dpensando que talvez o systemd assuma que é um sysvscript antigo, mas nenhuma mudança. O que devo ter no meu script para funcionar corretamente?
Meu script se parece com:

#!/bin/bash
EMFR=admin@server1.com
eml=admin@mydomain.com
dv0=p1p1
ipdv0=`ifconfig $dv0 | grep "inet " | awk '{print $2}'`
if [ "$1" = "stop" ]; then
  cat $msg | mail $EMFR -s "$srv-shut_down-ip-$ipdv0" $eml
fi
if [ "$1" = "start" ]; then
  cat $msg | mail $EMFR -s "$srv-booted_up-ip-$ipdv0" $eml  

fi

Devo incluir funções do antigo sistema sysv ou algo mais? Obrigado

scripting bash systemd systemd-service
  • 2 respostas
  • 264 Views
Martin Hope
DenisZ
Asked: 2021-05-25 22:32:27 +0800 CST

Como clonar o disco PMBR com setores defeituosos?

  • 0

Estou tentando clonar disco de 1 TB com partição PMBR e setores defeituosos. Que tem partições do Windows em funcionamento e é inicializável via MBR.
blkidnão reconhece partições

/dev/sdc: PTTYPE="PMBR"

gdisk /dev/sdc

    GPT fdisk (gdisk) version 1.0.7

Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!

Caution! After loading partitions, the CRC doesn't check out!
Warning: Invalid CRC on main header data; loaded backup partition table.
Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.

Warning! One or more CRCs don't match. You should repair the disk!
Main header: ERROR
Backup header: OK
Main partition table: ERROR
Backup partition table: ERROR

Partition table scan:
  MBR: hybrid
  BSD: not present
  APM: not present
  GPT: damaged

Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT

Your answer: 

Eu tentei gdiskcom ( 2) ( r) ( b) ( w) mas o resultado não quis escrever

 Warning! Main partition table overlaps the first partition by 34 blocks!
You will need to delete this partition or resize it in another utility.

Warning! Secondary partition table overlaps the last partition by
17599083851618035976 blocks!
You will need to delete this partition or resize it in another utility.

Problem: partitions 121 and 119 overlap:
  Partition 121: 925735787758310161 to 13474437941687892909
  Partition 119: 11147454187938441805 to 15638604846186930334

Problem: partitions 121 and 120 overlap:
  Partition 121: 925735787758310161 to 13474437941687892909
  Partition 120: 3391649715396322562 to 7297187905800799496

Problem: partitions 122 and 120 overlap:
  Partition 122: 3391649715396322562 to 7297187905800799496
  Partition 120: 3391649715396322562 to 7297187905800799496

Problem: partitions 122 and 121 overlap:
  Partition 122: 3391649715396322562 to 7297187905800799496
  Partition 121: 925735787758310161 to 13474437941687892909

Problem: partitions 123 and 119 overlap:
  Partition 123: 925735787758310161 to 13474437941687892909
  Partition 119: 11147454187938441805 to 15638604846186930334

Problem: partitions 123 and 120 overlap:
  Partition 123: 925735787758310161 to 13474437941687892909
  Partition 120: 3391649715396322562 to 7297187905800799496

Problem: partitions 123 and 121 overlap:
  Partition 123: 925735787758310161 to 13474437941687892909
  Partition 121: 925735787758310161 to 13474437941687892909

Problem: partitions 123 and 122 overlap:
  Partition 123: 925735787758310161 to 13474437941687892909
  Partition 122: 3391649715396322562 to 7297187905800799496

Problem: partitions 124 and 119 overlap:
  Partition 124: 10336404087008029236 to 15113227714779688721
  Partition 119: 11147454187938441805 to 15638604846186930334

Problem: partitions 124 and 121 overlap:
  Partition 124: 10336404087008029236 to 15113227714779688721
  Partition 121: 925735787758310161 to 13474437941687892909

Problem: partitions 124 and 123 overlap:
  Partition 124: 10336404087008029236 to 15113227714779688721
  Partition 123: 925735787758310161 to 13474437941687892909
Aborting write operation!
Aborting write of new partition table.

clonezilla não reconhece partições tentei o gparted e Rescue system partitions mas estava digitalizando a noite toda e nada.
usando: cfdisk /dev/sdc funciona bem

                                                                              Disk: /dev/sdc
                                                        Size: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
                                                                    Label: dos, identifier: 0x9f9fd106

    Device                 Boot                              Start                   End               Sectors              Size            Id Type
>>  /dev/sdc1                                                    1                206846                206846              101M            ee GPT                        
    /dev/sdc2              *                                206848             617201663             616994816            294.2G             7 HPFS/NTFS/exFAT
    /dev/sdc3                                            617201664            1916342271            1299140608            619.5G             7 HPFS/NTFS/exFAT
    /dev/sdc4                                           1916342272            1953316862              36974591             17.6G            c0 unknown
    Free space                                          1953316864            1953525167                208304            101.7M     

                                 

Como posso montar partições no fedora ou no PartedMagic ao vivo? Obrigado

mbr clonezilla rescue-disk
  • 2 respostas
  • 395 Views

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve