enthought / enthought/Python-2.7.3
subprocess.Popen: does not return complete output , when run through crontab
- Langage dominant
- Python
- Étoiles
- 3
- Forks
- 12
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I am calling some java binary in unix environment wrapped inside python script
When I call script from bash, output comes clean and also being stored in desired variable , However when i run the same script from Cron, Output stored(in a Variable) is incomplete
my code:
```
command = '/opt/HP/BSM/PMDB/bin/abcAdminUtil -abort -streamId ETL_' \
'SystemManagement_PA@Fact_SCOPE_OVPAGlobal'
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(output, err) = proc.communicate() # Storing Output in output variable
```
Value of output variable when running from shell:
```
Abort cmd output:PID:8717
Executing abort function
hibernateConfigurationFile = /OBRHA/HPE-OBR/PMDB/lib/hibernate-core-4.3.8.Final.jar
Starting to Abort Stream ETL_SystemManagement_PA@Fact_SCOPE_OVPAGlobal
Aborting StreamETL_SystemManagement_PA@Fact_SCOPE_OVPAGlobal
```
Value of output variable when running from cron:
```
PID:830
```
**It seems output after creating new process is not being stored into variable** , i don't know why ?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par l’exemple inline de subprocess.Popen et communicate(), puis reproduisez la commande à la fois dans un shell et avec crontab. Comparez l’environnement de cron et les stdout/stderr capturés ; le travail est terminé lorsque la cause de la différence de sortie est identifiée et que la capture complète lors de l’exécution via cron est confirmée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- operating-systems
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 20/100