[LON-CAPA-cvs] cvs: loncom / lonmemcached

raeburn raeburn at source.lon-capa.org
Sun Apr 27 18:15:30 EDT 2025


raeburn		Sun Apr 27 22:15:30 2025 EDT

  Modified files:              
    /loncom	lonmemcached 
  Log:
  - Use indirect object notation in calls to exec(). Explicitly provide port
    number for tcp, no port for udp, and localhost as listener interface.   
  
  
Index: loncom/lonmemcached
diff -u loncom/lonmemcached:1.7 loncom/lonmemcached:1.8
--- loncom/lonmemcached:1.7	Wed Aug 22 19:53:22 2007
+++ loncom/lonmemcached	Sun Apr 27 22:15:30 2025
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# $Id: lonmemcached,v 1.7 2007/08/22 19:53:22 albertel Exp $
+# $Id: lonmemcached,v 1.8 2025/04/27 22:15:30 raeburn Exp $
 
 $pidfile="/home/httpd/perl/logs/lonmemcached.pid";
 $logfile="/home/httpd/perl/logs/lonmemcached.log";
@@ -17,10 +17,13 @@
 print PIDSAVE "$$\n";
 close(PIDSAVE);
 
+my @args = ('-m','400','-l','127.0.0.1','-p','11211','-U','0','-v');
 if (-e '/usr/sbin/memcached') {
-    exec('/usr/sbin/memcached','-m','400','-v');
+    unshift(@args,'/usr/sbin/memcached');
+    exec( { $args[0] } @args);
 } elsif (-e '/usr/bin/memcached') {
-    exec('/usr/bin/memcached','-m','400','-v');
+    unshift(@args,'/usr/bin/memcached');
+    exec( { $args[0] } @args);
 } else {
     die("Unable to find memcached");
 }




More information about the LON-CAPA-cvs mailing list