Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 571888 Details for
Bug 753586
try-restart of a service scheduled to start disturbs its ordering (should be a NOP)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
self-contained test program
abc.pl (text/plain), 2.62 KB, created by
Jay Fenlason
on 2012-03-21 23:30:54 UTC
(
hide
)
Description:
self-contained test program
Filename:
MIME Type:
Creator:
Jay Fenlason
Created:
2012-03-21 23:30:54 UTC
Size:
2.62 KB
patch
obsolete
>#!/usr/bin/perl >sub usage() { > die ( "usage: $0 {create {b,c}, start {a,b,c} {b,c}, ,stop {a,b,c} {b,c}} \n" ); >} > >sub check_order($) { > usage() if ( $#ARGV != 2 ); > $mychar = $ARGV[1]; > $myrank = ord($mychar) - ord('a'); > die ( "parameter $mychar out of range\n" ) if ( $myrank < 0 || $myrank > 25); > $maxchar = $ARGV[2]; > $maxrank = ord($maxchar) - ord('a'); > die ( "parameter $maxchar out of range\n" ) if ( $maxrank < 0 || $maxrank > 25); > print STDERR $_[0]." $mychar of $maxchar\n"; > > for ( $i = 0; $i < $myrank; $i++ ) { > $ch = chr($i+ord('a')); > $file = "/run/abc/".$ch; > die ( "$mychar file $file not found\n" ) if ( ! -f $file ); > } >} > >usage() if ( $#ARGV < 0 ); >if ( $ARGV[0] eq "create" ) { > usage() if ( $#ARGV != 1 ); > $maxchar = $ARGV[1]; > $maxrank = ord($maxchar) - ord('a'); > die ( "parameter $ARGV[1] out of range\n" ) if ( $maxrank < 0 || $maxrank > 25); > mkdir "/run/abc"; > for ( $i = 0; $i <= $maxrank; $i++ ) { > $ch = chr($i+ord('a')); > open(OUTPUT,">","/etc/systemd/system/".$ch.".service") > or die ( "can't open service file\n" ); > print OUTPUT "[Unit]\n"; > print OUTPUT "Description=Test $ch service\n"; > print OUTPUT "Requires="; > for ( $j = 0; $j < $i; $j++ ) { > print OUTPUT chr($j+ord('a')).".service "; > } > print OUTPUT "\n"; > print OUTPUT "After="; > for ( $j = 0; $j < $i; $j++ ) { > print OUTPUT chr($j+ord('a')).".service "; > } > print OUTPUT "\n"; > print OUTPUT "[Service]\n"; > print OUTPUT "Type=oneshot\n"; > print OUTPUT "ExecStart=/usr/local/bin/abc.pl start $ch $maxchar\n"; > print OUTPUT "ExecStop=/usr/local/bin/abc.pl stop $ch $maxchar\n"; > print OUTPUT "RemainAfterExit=true\n"; > close OUTPUT; > } > system "systemctl daemon-reload"; > exit 0; >} elsif ( $ARGV[0] eq "remove" ) { > usage() if ( $#ARGV != 1 ); > $maxchar = $ARGV[1]; > $maxrank = ord($maxchar) - ord('a'); > die ( "parameter $ARGV[1] out of range\n" ) if ( $maxrank < 0 || $maxrank > 25); > for ( $i = 0; $i <= $maxrank; $i++ ) { > $ch = chr($i+ord('a')); > unlink ( "/etc/systemd/system/".$ch.".service" ); > unlink ( "/run/abc/$ch" ); > } > rmdir "/run/abc"; > system "systemctl daemon-reload"; > exit 0; >} elsif ( $ARGV[0] eq "stop" ) { > check_order("stopping"); > unlink "/run/abc/$mychar"; > exit 0; >} elsif ( $ARGV[0] eq "start" ) { > check_order("starting"); > for ( $i = $myrank + 1; $i <= $maxrank; $i++ ) { > $ch = chr($i+ord('a')); > print STDERR "$mychar try-restart of $ch\n"; > system "systemctl try-restart ".$ch.".service"; > } > sleep ( $myrank ); > mkdir "/run/abc"; > open(OUTPUT,">","/run/abc/$mychar") || die ( "$mychar Can't open output /run/abc/$mychar: $!\n" ); > close OUTPUT; > print STDERR "$mychar of $maxchar started\n"; > exit 0; >} else { > usage(); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 753586
:
533577
| 571888