Warning: Multiple build commands for output file

本文介绍了一种常见的编译警告:“Multiple build commands for output”,并提供了避免资源文件重复引入的方法,包括正确删除和添加资源文件等步骤。
今天编译项目;得到一个编译警告:
Warning: Multiple build commands for output /.../...

出现这种 Warning 的原因
由于将原来资源文件包删除,重新加入后,导致编译器在编译时,又一次引入了该资源!也就是说,编译的外部资源引入重复!

解决方法:

如何避免种情况的发生

1.删除项目文件,要从工程中删除。
2.切记,同一个资源不可重复引用到工程中。
3.添加资源,要从工程中添加。
4.最好,再删除资源后,先Clean 一下项目。

D:\AwesomeProject>npm run android > AwesomeProject@0.0.1 android > react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 1696 file(s) to forward-jetify. Using 12 workers... info JS server already running. info Installing the app... > Configure project :react-native-reanimated AAR for react-native-reanimated has been found D:\AwesomeProject\node_modules\react-native-reanimated\android\react-native-reanimated-68-jsc.aar > Task :jcore-react-native:processDebugManifest FAILED package="cn.jiguang.plugins.core" found in source AndroidManifest.xml: D:\AwesomeProject\node_modules\jcore-react-native\android\src\main\AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. See http://g.co/androidstudio/manifest-merger for more information about the manifest merger. > Task :react-native-async-storage_async-storage:processDebugManifest package="com.reactnativecommunity.asyncstorage" found in source AndroidManifest.xml: D:\AwesomeProject\node_modules\@react-native-async-storage\async-storage\android\src\main\AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. > Task :jpush-react-native:processDebugManifest package="cn.jiguang.plugins.push" found in source AndroidManifest.xml: D:\AwesomeProject\node_modules\jpush-react-native\android\src\main\AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. > Task :react-native-background-timer:processDebugManifest package="com.ocetnik.timer" found in source AndroidManifest.xml: D:\AwesomeProject\node_modules\react-native-background-timer\android\src\main\AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. > Task :react-native-camera:processGeneralDebugManifest package="org.reactnative.camera" found in source AndroidManifest.xml: D:\AwesomeProject\node_modules\react-native-camera\android\src\main\AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings 179 actionable tasks: 173 executed, 6 up-to-date <-------------> 0% WAITING > IDLE > IDLE > IDLE > IDLE > IDLE > IDLE > IDLE > IDLE > IDLE > IDLE > IDLE Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times. D:\AwesomeProject\node_modules\jcore-react-native\android\src\main\AndroidManifest.xml:41:9-45:19 Error: android:exported needs to be explicitly specified for element <service#cn.jiguang.plugins.service.JCoreModuleService>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':jcore-react-native:processDebugManifest'. > A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction > Manifest merger failed with multiple errors, see logs * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 25s error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times. D:\AwesomeProject\node_modules\jcore-react-native\android\src\main\AndroidManifest.xml:41:9-45:19 Error: android:exported needs to be explicitly specified for element <service#cn.jiguang.plugins.service.JCoreModuleService>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':jcore-react-native:processDebugManifest'. > A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction > Manifest merger failed with multiple errors, see logs * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 25s at makeError (D:\AwesomeProject\node_modules\execa\index.js:174:9) at D:\AwesomeProject\node_modules\execa\index.js:278:16 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async runOnAllDevices (D:\AwesomeProject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5) at async Command.handleAction (D:\AwesomeProject\node_modules\@react-native-community\cli\build\index.js:192:9) info Run CLI with --verbose flag for more details. 按照你说的做,还有以上的报错,怎么解决
08-09
[root@localhost snort-2.9.20]# sudo snort -T -c /etc/snort/snort.conf Running in Test mode --== Initializing Snort ==-- Initializing Output Plugins! Initializing Preprocessors! Initializing Plug-ins! Parsing Rules file "/etc/snort/snort.conf" PortVar 'HTTP_PORTS' defined : [ 80:81 311 383 591 593 901 1220 1414 1741 1830 2301 2381 2809 3037 3128 3702 4343 4848 5250 6988 7000:7001 7144:7145 7510 7777 7779 8000 8008 8014 8028 8080 8085 8088 8090 8118 8123 8180:8181 8243 8280 8300 8800 8888 8899 9000 9060 9080 9090:9091 9443 9999 11371 34443:34444 41080 50002 55555 ] PortVar 'SHELLCODE_PORTS' defined : [ 0:79 81:65535 ] PortVar 'ORACLE_PORTS' defined : [ 1024:65535 ] PortVar 'SSH_PORTS' defined : [ 22 ] PortVar 'FTP_PORTS' defined : [ 21 2100 3535 ] PortVar 'SIP_PORTS' defined : [ 5060:5061 5600 ] PortVar 'FILE_DATA_PORTS' defined : [ 80:81 110 143 311 383 591 593 901 1220 1414 1741 1830 2301 2381 2809 3037 3128 3702 4343 4848 5250 6988 7000:7001 7144:7145 7510 7777 7779 8000 8008 8014 8028 8080 8085 8088 8090 8118 8123 8180:8181 8243 8280 8300 8800 8888 8899 9000 9060 9080 9090:9091 9443 9999 11371 34443:34444 41080 50002 55555 ] PortVar 'GTP_PORTS' defined : [ 2123 2152 3386 ] Detection: Search-Method = AC-Full-Q Split Any/Any group = enabled Search-Method-Optimizations = enabled Maximum pattern length = 20 Tagged Packet Limit: 256 Loading dynamic engine /usr/local/lib/snort_dynamicengine/libsf_engine.so... done Loading all dynamic detection libs from /usr/local/lib/snort_dynamicrules... WARNING: No dynamic libraries found in directory /usr/local/lib/snort_dynamicrules. Finished Loading all dynamic detection libs from /usr/local/lib/snort_dynamicrules Loading all dynamic preprocessor libs from /usr/local/lib/snort_dynamicpreprocessor/... Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_pop_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_imap_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_smtp_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_ssh_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_dns_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_ssl_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_dce2_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_sdf_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_sip_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_reputation_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_gtp_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_modbus_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_dnp3_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_s7commplus_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_appid_preproc.so... done Loading dynamic preprocessor library /usr/local/lib/snort_dynamicpreprocessor//libsf_ftptelnet_preproc.so... done Finished Loading all dynamic preprocessor libs from /usr/local/lib/snort_dynamicpreprocessor/ Log directory = /var/log/snort WARNING: ip4 normalizations disabled because not inline. WARNING: tcp normalizations disabled because not inline. WARNING: icmp4 normalizations disabled because not inline. WARNING: ip6 normalizations disabled because not inline. WARNING: icmp6 normalizations disabled because not inline. Frag3 global config: Max frags: 65536 Fragment memory cap: 4194304 bytes Frag3 engine config: Bound Address: default Target-based policy: WINDOWS Fragment timeout: 180 seconds Fragment min_ttl: 1 Fragment Anomalies: Alert Overlap Limit: 10 Min fragment Length: 100 Max Expected Streams: 768 Stream global config: Track TCP sessions: ACTIVE Max TCP sessions: 262144 TCP cache pruning timeout: 30 seconds TCP cache nominal timeout: 3600 seconds Memcap (for reassembly packet storage): 8388608 Track UDP sessions: ACTIVE Max UDP sessions: 131072 UDP cache pruning timeout: 30 seconds UDP cache nominal timeout: 180 seconds Track ICMP sessions: INACTIVE Track IP sessions: INACTIVE Log info if session memory consumption exceeds 1048576 Send up to 2 active responses Wait at least 5 seconds between responses Protocol Aware Flushing: ACTIVE Maximum Flush Point: 16000 Stream TCP Policy config: Bound Address: default Reassembly Policy: WINDOWS Timeout: 180 seconds Limit on TCP Overlaps: 10 Maximum number of bytes to queue per session: 1048576 Maximum number of segs to queue per session: 2621 Options: Require 3-Way Handshake: YES 3-Way Handshake Timeout: 180 Detect Anomalies: YES Reassembly Ports: 21 client (Footprint) 22 client (Footprint) 23 client (Footprint) 25 client (Footprint) 42 client (Footprint) 53 client (Footprint) 79 client (Footprint) 80 client (Footprint) server (Footprint) 81 client (Footprint) server (Footprint) 109 client (Footprint) 110 client (Footprint) 111 client (Footprint) 113 client (Footprint) 119 client (Footprint) 135 client (Footprint) 136 client (Footprint) 137 client (Footprint) 139 client (Footprint) 143 client (Footprint) 161 client (Footprint) additional ports configured but not printed. Stream UDP Policy config: Timeout: 180 seconds HttpInspect Config: GLOBAL CONFIG Detect Proxy Usage: NO IIS Unicode Map Filename: /etc/snort/unicode.map IIS Unicode Map Codepage: 1252 Memcap used for logging URI and Hostname: 150994944 Max Gzip Memory: 838860 Max Gzip Sessions: 1807 Gzip Compress Depth: 65535 Gzip Decompress Depth: 65535 Normalize Random Nulls in Text: NO DEFAULT SERVER CONFIG: Server profile: All Ports (PAF): 80 81 311 383 591 593 901 1220 1414 1741 1830 2301 2381 2809 3037 3128 3702 4343 4848 5250 6988 7000 7001 7144 7145 7510 7777 7779 8000 8008 8014 8028 8080 8085 8088 8090 8118 8123 8180 8181 8243 8280 8300 8800 8888 8899 9000 9060 9080 9090 9091 9443 9999 11371 34443 34444 41080 50002 55555 Server Flow Depth: 0 Client Flow Depth: 0 Max Chunk Length: 500000 Small Chunk Length Evasion: chunk size <= 10, threshold >= 5 times Max Header Field Length: 750 Max Number Header Fields: 100 Max Number of WhiteSpaces allowed with header folding: 200 Inspect Pipeline Requests: YES URI Discovery Strict Mode: NO Allow Proxy Usage: NO Disable Alerting: NO Oversize Dir Length: 500 Only inspect URI: NO Normalize HTTP Headers: NO Inspect HTTP Cookies: YES Inspect HTTP Responses: YES Extract Gzip from responses: YES Decompress response files: Unlimited decompression of gzip data from responses: YES Normalize Javascripts in HTTP Responses: YES Max Number of WhiteSpaces allowed with Javascript Obfuscation in HTTP responses: 200 Normalize HTTP Cookies: NO Enable XFF and True Client IP: NO Log HTTP URI data: NO Log HTTP Hostname data: NO Extended ASCII code support in URI: NO Ascii: YES alert: NO Double Decoding: YES alert: NO %U Encoding: YES alert: YES Bare Byte: YES alert: NO UTF 8: YES alert: NO IIS Unicode: YES alert: NO Multiple Slash: YES alert: NO IIS Backslash: YES alert: NO Directory Traversal: YES alert: NO Web Root Traversal: YES alert: NO Apache WhiteSpace: YES alert: NO IIS Delimiter: YES alert: NO IIS Unicode Map: GLOBAL IIS UNICODE MAP CONFIG Non-RFC Compliant Characters: 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 Whitespace Characters: 0x09 0x0b 0x0c 0x0d Legacy mode: NO rpc_decode arguments: Ports to decode RPC on: 111 32770 32771 32772 32773 32774 32775 32776 32777 32778 32779 alert_fragments: INACTIVE alert_large_fragments: INACTIVE alert_incomplete: INACTIVE alert_multiple_requests: INACTIVE MaxRss at the end of static preproc config:24448 FTPTelnet Config: GLOBAL CONFIG Inspection Type: stateful Check for Encrypted Traffic: YES alert: NO Continue to check encrypted data: YES TELNET CONFIG: Ports: 23 Are You There Threshold: 20 Normalize: YES Detect Anomalies: YES FTP CONFIG: FTP Server: default Ports (PAF): 21 2100 3535 Check for Telnet Cmds: YES alert: YES Ignore Telnet Cmd Operations: YES alert: YES Ignore open data channels: NO FTP Client: default Check for Bounce Attacks: YES alert: YES Check for Telnet Cmds: YES alert: YES Ignore Telnet Cmd Operations: YES alert: YES Max Response Length: 256 SMTP Config: Ports: 25 465 587 691 Inspection Type: Stateful Normalize: ATRN AUTH BDAT DATA DEBUG EHLO EMAL ESAM ESND ESOM ETRN EVFY EXPN HELO HELP IDENT MAIL NOOP ONEX QUEU QUIT RCPT RSET SAML SEND STARTTLS SOML TICK TIME TURN TURNME VERB VRFY X-EXPS XADR XAUTH XCIR XEXCH50 XGEN XLICENSE X-LINK2STATE XQUE XSTA XTRN XUSR CHUNKING X-ADAT X-DRCP X-ERCP X-EXCH50 Ignore Data: No Ignore TLS Data: No Ignore SMTP Alerts: No Max Command Line Length: 512 Max auth Command Line Length: 1000 Max Specific Command Line Length: ATRN:255 AUTH:246 BDAT:255 DATA:246 DEBUG:255 EHLO:500 EMAL:255 ESAM:255 ESND:255 ESOM:255 ETRN:246 EVFY:255 EXPN:255 HELO:500 HELP:500 IDENT:255 MAIL:260 NOOP:255 ONEX:246 QUEU:246 QUIT:246 RCPT:300 RSET:246 SAML:246 SEND:246 SIZE:255 STARTTLS:246 SOML:246 TICK:246 TIME:246 TURN:246 TURNME:246 VERB:246 VRFY:255 X-EXPS:246 XADR:246 XAUTH:246 XCIR:246 XEXCH50:246 XGEN:246 XLICENSE:246 X-LINK2STATE:246 XQUE:246 XSTA:246 XTRN:246 XUSR:246 Max Header Line Length: 1000 Max Response Line Length: 512 X-Link2State Alert: Yes Drop on X-Link2State Alert: No Alert on commands: None Alert on unknown commands: No SMTP Memcap: 838860 MIME Max Mem: 838860 Base64 Decoding: Enabled Base64 Decoding Depth: Unlimited Quoted-Printable Decoding: Enabled Quoted-Printable Decoding Depth: Unlimited Unix-to-Unix Decoding: Enabled Unix-to-Unix Decoding Depth: Unlimited Non-Encoded MIME attachment Extraction: Enabled Non-Encoded MIME attachment Extraction Depth: Unlimited Log Attachment filename: Enabled Log MAIL FROM Address: Enabled Log RCPT TO Addresses: Enabled Log Email Headers: Enabled Email Hdrs Log Depth: 1464 SSH config: Autodetection: ENABLED Challenge-Response Overflow Alert: ENABLED SSH1 CRC32 Alert: ENABLED Server Version String Overflow Alert: ENABLED Protocol Mismatch Alert: ENABLED Bad Message Direction Alert: DISABLED Bad Payload Size Alert: DISABLED Unrecognized Version Alert: DISABLED Max Encrypted Packets: 20 Max Server Version String Length: 100 MaxClientBytes: 19600 (Default) Ports: 22 DCE/RPC 2 Preprocessor Configuration Global Configuration DCE/RPC Defragmentation: Enabled Memcap: 102400 KB Events: co SMB Fingerprint policy: Disabled Server Default Configuration Policy: WinXP Detect ports (PAF) SMB: 139 445 TCP: 135 UDP: 135 RPC over HTTP server: 593 RPC over HTTP proxy: None Autodetect ports (PAF) SMB: None TCP: 1025-65535 UDP: 1025-65535 RPC over HTTP server: 1025-65535 RPC over HTTP proxy: None Invalid SMB shares: C$ D$ ADMIN$ Maximum SMB command chaining: 3 commands SMB file inspection: Disabled DNS config: DNS Client rdata txt Overflow Alert: ACTIVE Obsolete DNS RR Types Alert: INACTIVE Experimental DNS RR Types Alert: INACTIVE Ports: 53 SSLPP config: Encrypted packets: not inspected Ports: 443 465 563 636 989 992 993 994 995 7801 7802 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 Server side data is trusted Maximum SSL Heartbeat length: 0 Sensitive Data preprocessor config: Global Alert Threshold: 25 Masked Output: DISABLED SIP config: Max number of sessions: 40000 Max number of dialogs in a session: 4 (Default) Status: ENABLED Ignore media channel: DISABLED Max URI length: 512 Max Call ID length: 80 Max Request name length: 20 (Default) Max From length: 256 (Default) Max To length: 256 (Default) Max Via length: 1024 (Default) Max Contact length: 512 Max Content length: 2048 Ports: 5060 5061 5600 Methods: invite cancel ack bye register options refer subscribe update join info message notify benotify do qauth sprack publish service unsubscribe prack IMAP Config: Ports: 143 IMAP Memcap: 838860 MIME Max Mem: 838860 Base64 Decoding: Enabled Base64 Decoding Depth: Unlimited Quoted-Printable Decoding: Enabled Quoted-Printable Decoding Depth: Unlimited Unix-to-Unix Decoding: Enabled Unix-to-Unix Decoding Depth: Unlimited Non-Encoded MIME attachment Extraction: Enabled Non-Encoded MIME attachment Extraction Depth: Unlimited POP Config: Ports: 110 POP Memcap: 838860 MIME Max Mem: 838860 Base64 Decoding: Enabled Base64 Decoding Depth: Unlimited Quoted-Printable Decoding: Enabled Quoted-Printable Decoding Depth: Unlimited Unix-to-Unix Decoding: Enabled Unix-to-Unix Decoding Depth: Unlimited Non-Encoded MIME attachment Extraction: Enabled Non-Encoded MIME attachment Extraction Depth: Unlimited Modbus config: Ports: 502 DNP3 config: Memcap: 262144 Check Link-Layer CRCs: ENABLED Ports: 20000 Reputation config: WARNING: Can't find any whitelist/blacklist entries. Reputation Preprocessor disabled. MaxRss at the end of dynamic preproc config:28608 +++++++++++++++++++++++++++++++++++++++++++++++++++ Initializing rule chains... WARNING: /etc/snort/rules/local.rules(3) threshold (in rule) is deprecated; use detection_filter instead. WARNING: /etc/snort/rules/local.rules(3) GID 1 SID 1000002 in rule duplicates previous rule. Ignoring old rule. WARNING: /etc/snort/snort.conf(691) GID 1 SID 1000001 in rule duplicates previous rule. Ignoring old rule. 4 Snort rules read 2 detection rules 0 decoder rules 0 preprocessor rules 2 Option Chains linked into 3 Chain Headers +++++++++++++++++++++++++++++++++++++++++++++++++++ +-------------------[Rule Port Counts]--------------------------------------- | tcp udp icmp ip | src 0 0 0 0 | dst 2 0 0 0 | any 2 0 0 0 | nc 4 0 0 0 | s+d 0 0 0 0 +---------------------------------------------------------------------------- +-----------------------[detection-filter-config]------------------------------ | memory-cap : 1048576 bytes +-----------------------[detection-filter-rules]------------------------------- | none ------------------------------------------------------------------------------- +-----------------------[rate-filter-config]----------------------------------- | memory-cap : 1048576 bytes +-----------------------[rate-filter-rules]------------------------------------ | none ------------------------------------------------------------------------------- +-----------------------[event-filter-config]---------------------------------- | memory-cap : 1048576 bytes +-----------------------[event-filter-global]---------------------------------- | none +-----------------------[event-filter-local]----------------------------------- | gen-id=1 sig-id=1000002 type=Both tracking=src count=5 seconds=10 +-----------------------[suppression]------------------------------------------ | none ------------------------------------------------------------------------------- Rule application order: pass->drop->sdrop->reject->alert->log Verifying Preprocessor Configurations! MaxRss at the end of rules:43320 [ Port Based Pattern Matching Memory ] [ Number of patterns truncated to 20 bytes: 0 ] MaxRss at the end of detection rules:43320 pcap DAQ configured to passive. Acquiring network traffic from "ens33". --== Initialization Complete ==-- ,,_ -*> Snort! <*- o" )~ Version 2.9.20 GRE (Build 82) '''' By Martin Roesch & The Snort Team: http://www.snort.org/contact#team Copyright (C) 2014-2022 Cisco and/or its affiliates. All rights reserved. Copyright (C) 1998-2013 Sourcefire, Inc., et al. Using libpcap version 1.5.3 Using PCRE version: 8.32 2012-11-30 Using ZLIB version: 1.2.7 Rules Engine: SF_SNORT_DETECTION_ENGINE Version 3.2 <Build 1> Preprocessor Object: SF_FTPTELNET Version 1.2 <Build 13> Preprocessor Object: appid Version 1.1 <Build 5> Preprocessor Object: SF_S7COMMPLUS Version 1.0 <Build 1> Preprocessor Object: SF_DNP3 Version 1.1 <Build 1> Preprocessor Object: SF_MODBUS Version 1.1 <Build 1> Preprocessor Object: SF_GTP Version 1.1 <Build 1> Preprocessor Object: SF_REPUTATION Version 1.1 <Build 1> Preprocessor Object: SF_SIP Version 1.1 <Build 1> Preprocessor Object: SF_SDF Version 1.1 <Build 1> Preprocessor Object: SF_DCERPC2 Version 1.0 <Build 3> Preprocessor Object: SF_SSLPP Version 1.1 <Build 4> Preprocessor Object: SF_DNS Version 1.1 <Build 4> Preprocessor Object: SF_SSH Version 1.1 <Build 3> Preprocessor Object: SF_SMTP Version 1.1 <Build 9> Preprocessor Object: SF_IMAP Version 1.0 <Build 1> Preprocessor Object: SF_POP Version 1.0 <Build 1> Total snort Fixed Memory Cost - MaxRss:43584 Snort successfully validated the configuration! Snort exiting [root@localhost snort-2.9.20]#
05-17
解析以下函数:“def execute(reptrav, multiple=False, with_dbg=False, only_env=False, follow_output=True, fpara=None, facmtps=1., runner=None, **kargs): """Run a Code_Aster execution in 'reptrav'. Arguments : multiple : False if only one execution is run (so stop if it fails), True if several executions are run (don't stop when error occurs) with_dbg : start debugger or not, fpara : deprecated, follow_output : print output to follow the execution, kargs give "run, conf, prof, build" instances + exec name Return a tuple (diag, tcpu, tsys, ttot, validbase). """ # 1. ----- initializations run = kargs['run'] conf = kargs['conf'] prof = kargs['prof'] build = kargs['build'] exetmp = kargs['exe'] ctest = prof['parent'][0] == "astout" waf_inst = build.support('waf') waf_nosupv = build.support('nosuperv') waf_noresu = build.support('noresu') waf_orb = build.support('orbinitref') use_numthreads = build.support('use_numthreads') run.DBG("version supports: waf ({0}), nosuperv ({1}), " "orbinitref ({2}), numthreads ({3})".format(waf_inst, waf_nosupv, waf_orb, use_numthreads)) if not waf_inst: exetmp = osp.join('.', osp.basename(exetmp)) tcpu = 0. tsys = 0. ttot = 0. validbase = True if runner is None: runner = Runner() runner.set_rep_trav(reptrav) interact = ('interact' in prof.args or prof.args.get('args', '').find('-interact') > -1) hide_command = ("hide-command" in prof.args or prof.args.get('args', '').find('--hide-command') > -1) os.chdir(reptrav) # 2. ----- list of command files list_comm = glob('fort.1.*') list_comm.sort() if osp.exists('fort.1'): list_comm.insert(0, 'fort.1') if waf_nosupv: for fcomm in list_comm: add_import_commands(fcomm) # 3. ----- arguments list drep = { 'REPOUT' : 'rep_outils', 'REPMAT' : 'rep_mat', 'REPDEX' : 'rep_dex' } cmd = [] if waf_nosupv: if interact: cmd.append('-i') cmd.append('fort.1') else: if waf_inst: cmd.append(osp.join(conf['SRCPY'][0], conf['ARGPYT'][0])) else: cmd.append(osp.join(conf['REPPY'][0], conf['ARGPYT'][0])) cmd.extend(conf['ARGEXE']) # warning: using --commandes will turn off backward compatibility cmd.append('-commandes') cmd.append('fort.1') # cmd.append(_fmtoption('command', 'fort.1')) # remove deprecated options long_opts_rm = ['rep', 'mem', 'mxmemdy', 'memory_stat', 'memjeveux_stat', 'type_alloc', 'taille', 'partition', 'origine', 'eficas_path'] # for version < 12.6/13.2 that does not support --ORBInitRef=, ignore it if not waf_orb: long_opts_rm.append('ORBInitRef') cmd_memtps = {} for k, v in list(prof.args.items()): if k == 'args': cmd.append(prof.args[k]) elif k in long_opts_rm: warn("this command line option is deprecated : --%s" % k, DeprecationWarning, stacklevel=3) elif k in ('memjeveux', 'tpmax'): cmd_memtps[k] = v elif v.strip() == '' and k in list(drep.values()): run.Mess(_('empty value not allowed for "%s"') % k, '<A>_INVALID_PARAMETER') else: cmd.append(_fmtoption(k, v)) # add arguments to find the process (for as_actu/as_del) if not 'astout' in prof['actions'] and not 'distribution' in prof['actions']: cmd.append(_fmtoption('num_job', run['num_job'])) cmd.append(_fmtoption('mode', prof['mode'][0])) # arguments which can be set in file 'config.txt' for kconf, karg in list(drep.items()): if conf[kconf][0] != '' and not karg in list(prof.args.keys()): cmd.append(_fmtoption(karg, conf[kconf][0])) ncpus = prof['ncpus'][0] try: ncpus = max(1, int(ncpus)) except ValueError: ncpus = '' if use_numthreads: if ncpus == '': ncpus = max([run[prof['mode'][0] + '_nbpmax'] // 2, 1]) cmd.append(_fmtoption('numthreads', ncpus)) elif ncpus == '': ncpus = '1' # 4. ----- add parameters from prof if on_64bits(): facW = 8 else: facW = 4 tps = 0 memj = 0 nbp = 0 try: tps = int(float(prof.args['tpmax'])) except KeyError: run.Mess(_('tpmax not provided in profile'), '<E>_INCORRECT_PARA') except ValueError: run.Mess(_('incorrect value for tpmax (%s) in profile') % \ prof.args['tpmax'], '<E>_INCORRECT_PARA') try: memj = float(prof.args['memjeveux']) except KeyError: run.Mess(_('memjeveux not provided in profile'), '<E>_INCORRECT_PARA') except ValueError: run.Mess(_('incorrect value for memjeveux (%s) in profile') % \ prof.args['memjeveux'], '<E>_INCORRECT_PARA') try: nbp = int(ncpus) except ValueError: run.Mess(_('incorrect value for ncpus (%s) in profile') % \ prof['ncpus'][0], '<E>_INCORRECT_PARA') # 4.1. check for memory, time and procs limits run.Mess(_('Parameters : memory %d MB - time limit %d s') % (memj*facW, tps)) check_limits(run, prof['mode'][0], tps, memj*facW, nbp, runner.nbnode(), runner.nbcpu()) # check for previous errors (parameters) if not multiple: run.CheckOK() elif run.GetGrav(run.diag) > run.GetGrav('<A>'): run.Mess(_('error in parameters : %s') % run.diag) return run.diag, tcpu, tsys, ttot, validbase # 5. ----- only environment, print command lines to execute if only_env: run.Mess(ufmt(_('Code_Aster environment prepared in %s'), reptrav), 'OK') run.Mess(_('To start execution copy/paste following lines in a ksh/bash shell :')) run.Mess(' cd %s' % reptrav, 'SILENT') run.Mess(' . %s' % osp.join(confdir, 'profile.sh'), 'SILENT') tmp_profile = "profile_tmp.sh" with open(tmp_profile, 'w') as f: f.write(""" export PYTHONPATH=$PYTHONPATH:. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. """) # set per version environment for f in conf.get_with_absolute_path('ENV_SH') + [tmp_profile]: run.Mess(' . %s' % f, 'SILENT') cmd.insert(0, exetmp) # add memjeveux and tpmax cmd.extend([_fmtoption(k, v) for k, v in list(cmd_memtps.items())]) cmdline = ' '.join(cmd) # get pdb.py path pdbpy_cmd = "import os, sys ; " \ "pdbpy = os.path.join(sys.prefix, 'lib', 'python' + sys.version[:3], 'pdb.py')" d = {} exec(pdbpy_cmd, d) pdbpy = d['pdbpy'] if runner.really(): #XXX and if not ? perhaps because of exit_code cmdline = runner.get_exec_command(cmdline, add_tee=False, env=conf.get_with_absolute_path('ENV_SH')) # print command lines k = 0 for fcomm in list_comm: k += 1 run.Mess(_("Command line %d :") % k) run.Mess("cp %s fort.1" % fcomm, 'SILENT') run.Mess(cmdline, 'SILENT') # how to start the Python debugger if not runner.really(): run.Mess(_('To start execution in the Python debugger you could type :'), 'SILENT') pdb_cmd = cmdline.replace(exetmp, '%s %s' % (exetmp, ' '.join(pdbpy.splitlines()))) run.Mess("cp %s fort.1" % fcomm, 'SILENT') run.Mess(pdb_cmd, 'SILENT') diag = 'OK' # 6. ----- really execute else: # 6.1. content of reptrav if not ctest: run.Mess(ufmt(_('Content of %s before execution'), reptrav), 'TITLE') out = run.Shell(cmd='ls -la')[1] print(out) if len(list_comm) == 0: run.Mess(_('no .comm file found'), '<E>_NO_COMM_FILE') # check for previous errors (copy datas) if not multiple: run.CheckOK() elif run.GetGrav(run.diag) > run.GetGrav('<A>'): run.Mess(_('error occurs during preparing data : %s') % run.diag) return run.diag, tcpu, tsys, ttot, validbase # 6.2. complete command line cmd.append('--suivi_batch') add_tee = False if with_dbg: # how to run the debugger cmd_dbg = run.config.get('cmd_dbg', '') if not cmd_dbg: run.Mess(_('command line to run the debugger not defined'), '<F>_DEBUG_ERROR') if cmd_dbg.find('gdb') > -1: ldbg = ['break main', ] else: ldbg = ['stop in main', ] # add memjeveux and tpmax update_cmd_memtps(cmd_memtps) cmd.extend([_fmtoption(k, v) for k, v in list(cmd_memtps.items())]) pos_memtps = -1 cmd_args = ' '.join(cmd) ldbg.append('run ' + cmd_args) cmd = getdbgcmd(cmd_dbg, exetmp, '', ldbg, cmd_args) else: add_tee = True cmd.insert(0, exetmp) # position where insert memjeveux+tpmax pos_memtps = len(cmd) # keep for compatibility with version < 13.1 os.environ['OMP_NUM_THREADS'] = str(ncpus) # unlimit coredump size try: corefilesize = int(prof['corefilesize'][0]) * 1024*1024 except ValueError: corefilesize = 'unlimited' run.SetLimit('core', corefilesize) # 6.3. if multiple .comm files, keep previous bases if len(list_comm) > 1: run.Mess(_('%d command files') % len(list_comm)) validbase = False BASE_PREC = osp.join(reptrav, 'BASE_PREC') run.MkDir(BASE_PREC) # 6.4. for each .comm file diag = '?' diag_ok = None k = 0 for fcomm in list_comm: k += 1 os.chdir(runner.reptrav()) run.Copy('fort.1', fcomm) # start execution tit = _('Code_Aster run') run.timer.Start(tit) # add memjeveux and tpmax at the right position if os.name != 'nt' or not add_tee: cmd_i = cmd[:] else: print("cmd", cmd) cmd_i = [cm.replace(" ","\" \"") if not cm.startswith("--max_") else cm for cm in cmd] update_cmd_memtps(cmd_memtps) if pos_memtps > -1: for key, value in list(cmd_memtps.items()): cmd_i.insert(pos_memtps, _fmtoption(key, value)) if True or not ctest: run.Mess(tit, 'TITLE') run.Mess(_('Command line %d :') % k) if not run['verbose']: run.Mess(' '.join(cmd_i)) if waf_nosupv and not hide_command: dash = "# " + "-" * 90 with open('fort.1', 'rb') as f: content =[_("Content of the file to execute"), dash, to_unicode(f.read()), dash] run.Mess(os.linesep.join(content)) cmd_exec = runner.get_exec_command(' '.join(cmd_i), add_tee=add_tee, env=conf.get_with_absolute_path('ENV_SH')) # go iret, exec_output = run.Shell(cmd_exec, follow_output=follow_output, interact=interact) if iret != 0: cats = ['fort.6'] if not waf_noresu: cats.extend(['fort.8', 'fort.9']) for f in cats: run.FileCat(text="""\n <I>_EXIT_CODE = %s""" % iret, dest=f) if not follow_output and not ctest: print(exec_output) # mpirun does not include cpu/sys time of childrens, add it in timer if exec_output: runner.add_to_timer(exec_output, tit) run.timer.Stop(tit) if k < len(list_comm): for b in glob('vola.*')+glob('loca.*'): run.Delete(b, remove_dirs=False) if len(list_comm) > 1: ldiag = build.getDiag(cas_test=ctest) diag_k = ldiag[0] tcpu += ldiag[1] tsys += ldiag[2] ttot += ldiag[3] run.FileCat('fort.6', 'fort_bis.6') run.Delete('fort.6', remove_dirs=False) if not waf_noresu: run.FileCat('fort.8', 'fort_bis.8') run.Delete('fort.8', remove_dirs=False) run.FileCat('fort.9', 'fort_bis.9') run.Delete('fort.9', remove_dirs=False) if re.search('<[ESF]{1}>', diag_k): # switch <F> to <E> if multiple .comm if diag_k.find('<F>') > -1: diag_k = diag_k.replace('<F>', '<E>') # ...and try to restore previous bases run.Mess(ufmt(_('restore bases from %s'), BASE_PREC)) lbas = glob(osp.join(BASE_PREC, 'glob.*')) + \ glob(osp.join(BASE_PREC, 'bhdf.*')) + \ glob(osp.join(BASE_PREC, 'pick.*')) if len(lbas) > 0: run.Copy(os.getcwd(), niverr='INFO', verbose=follow_output, *lbas) else: run.Mess(_('no glob/bhdf base to restore'), '<A>_ALARM') run.Mess(_('execution aborted (comm file #%d)') % k, diag_k) diag = diag_k break else: # save bases in BASE_PREC if next execution fails validbase = True if k < len(list_comm): if not ctest: run.Mess(ufmt(_('save bases into %s'), BASE_PREC)) lbas = glob('glob.*') + \ glob('bhdf.*') + \ glob('pick.*') run.Copy(BASE_PREC, niverr='INFO', verbose=follow_output, *lbas) run.Mess(_('execution ended (comm file #%d)') % k, diag_k) # at least one is ok/alarm ? keep the "worse good" status! if run.GetGrav(diag_k) in (0, 1): diag_ok = diag_ok or 'OK' if run.GetGrav(diag_ok) < run.GetGrav(diag_k): diag_ok = diag_k # the worst diagnostic if run.GetGrav(diag) < run.GetGrav(diag_k): diag = diag_k # 6.5. global diagnostic if len(list_comm) > 1: run.Rename('fort_bis.6', 'fort.6') run.Rename('fort_bis.8', 'fort.8') run.Rename('fort_bis.9', 'fort.9') else: diag, tcpu, tsys, ttot = build.getDiag(cas_test=ctest)[:4] validbase = run.GetGrav(diag) <= run.GetGrav('<S>') if ctest and run.GetGrav(diag) < 0: diag = '<F>_' + diag if ctest and diag == 'NO_TEST_RESU' and diag_ok: diag = diag_ok run.ReinitDiag(diag) # expected diagnostic ? if prof['expected_diag'][0]: expect = prof['expected_diag'][0] if run.GetGrav(diag) >= run.GetGrav('<E>'): diag = '<F>_ERROR' if run.GetGrav(diag) == run.GetGrav(expect): run.Mess(_('Diagnostic is as expected.')) diag = 'OK' else: run.Mess(_("Diagnostic is not as expected (got '%s').") % diag) diag = 'NOOK_TEST_RESU' run.ReinitDiag(diag) run.Mess(_('Code_Aster run ended, diagnostic : %s') % diag) # 6.6. post-mortem analysis of the core file if not with_dbg: cmd_dbg = run.config.get('cmd_post', '') lcor = glob('core*') if cmd_dbg and lcor: run.Mess(_('Code_Aster run created a coredump'), '<E>_CORE_FILE') if not multiple: # take the first one if several core files core = lcor[0] run.Mess(ufmt(_('core file name : %s'), core)) cmd = getdbgcmd(cmd_dbg, exetmp, core, ('where', 'quit'), '') tit = _('Coredump analysis') run.Mess(tit, 'TITLE') run.timer.Start(tit) iret, output = run.Shell(' '.join(cmd), alt_comment='coredump analysis...', verbose=True) if iret == 0 and not ctest: print(output) run.timer.Stop(tit) if not ctest: # 6.7. content of reptrav run.Mess(ufmt(_('Content of %s after execution'), os.getcwd()), 'TITLE') out = run.Shell(cmd='ls -la . REPE_OUT')[1] print(out) # 6.8. print some informations run.Mess(_('Size of bases'), 'TITLE') lf = glob('vola.*') lf.extend(glob('loca.*')) lf.extend(glob('glob.*')) lf.extend(glob('bhdf.*')) lf.extend(glob('pick.*')) for f in lf: run.Mess(_('size of %s : %12d bytes') % (f, os.stat(f).st_size)) return diag, tcpu, tsys, ttot, validbase def _fmtoption(key, value=None): """Format an option""" key = key.lstrip('-') if value is None or (type(value) is str and not value.strip()): fmt = '--{0}'.format(key) else: fmt = '--{0}={1}'.format(key, value) return fmt ”
07-10
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值