我正在尝试执行一个子进程,在我的脚本中完成了几次。但在最后一个,它输出一个我找不到解决方案的错误。使用在命令行生成的相同文件的完全相同的命令可以正常工作。
有问题的代码行:
sfmove = subprocess.call(["dnssec-signzone","-e",strftime("%Y%m%d%H", gmtime())+"0000","-p","-t","-g","-","K"+name+".ksk.key","-o",name,name+".external","K"+name+".zsk.key"])
脚本的输出
# python3.4 makekeys.py
Enter the domain to configure keys for? test123.com
Generating key pair....................................................................+++ ................................................................................+++
K
Generating key pair...........................................................+++ .................................................................................+++
K
dnssec-signzone: fatal: No self-signed KSK DNSKEY found. Supply an active
key with the KSK flag set, or use '-P'.
在命令行签名工作:
dnssec-signzone -e20180330000000 -p -t -g -k Ktest123.com.ksk.key -o test123.com test123.com.external Ktest123.com.zsk.key
Verifying the zone using the following algorithms: RSASHA256.
Zone fully signed:
Algorithm: RSASHA256: KSKs: 1 active, 0 stand-by, 0 revoked
ZSKs: 1 active, 0 stand-by, 0 revoked
test123.com.external.signed
Signatures generated: 9
Signatures retained: 0
Signatures dropped: 0
Signatures successfully verified: 0
Signatures unsuccessfully verified: 0
Signing time in seconds: 0.010
Signatures per second: 875.401
Runtime in seconds: 0.013
如何通过 Python 正确执行 dnssec-signzone?
url 完成代码CODE